Here’s an explanation of the types of files you should avoid placing in the WordPress public directory.

The Risks of Leaving Files in the WordPress Public Directory
Hackers may scan and obtain files left in the directory containing your WordPress site’s program files.
For example, if you store a backup of `wp-config.php` with a different file extension, hackers can expose your database connection ID and password simply by accessing that file over the internet.
If your database connection information is leaked to a hacker, your database could be tampered with—resulting in the addition of unauthorized administrators or the injection of spam content into your site.
Hackers also target a variety of other files.
We recommend that you avoid placing the following types of files in your WordPress directory:
・Database connectionprograms such asphpMyAdmin
・File upload or deletion programs such as filemanager.php
・Backups of wp-config.php, or files containing database connection information, etc.
* Hackers often scan (using brute-force attacks) for files with the following filenames in an attempt to obtain them:
wp-config.php.bak / wp-config.php~ / wp-config.old / wp-config.txt / wp-config.php.save
・Files that display PHP version or configuration information, such as phpinfo.php
* Data such as server configuration may serve as a foothold for hackers. Hackers often scan for and attempt to obtain files with names like the following:
phpinfo.php / info.php / test.php / pi.php
・Configuration files for other systems, such as .env
Docker’s .env files and Git-managed .git directories may contain the site’s entire source code or database connection information. GitHub accounts and repositories may also be exposed via the .git directory.
・Database backup files such as db.sql, dumo.sql, backup.sql, and backup.zip
・For older versions of WordPress: readme.html, license.txt
Older versions of WordPress contained version information and other details in these files, so hackers might be able to tell that you’re running an outdated system.
Won’t the system be exposed if the filenames are random strings?
Since hackers predict the names of targeted files and directories and attempt to access them using a brute-force approach, files with sufficiently long, random filenames are less likely to be discovered.
However, unless you’ve disabled directory listings via `Options -Indexes` or a security plugin, simply opening a folder (if there’s no `index` file) may reveal all the filenames.
If even a single backup file or .git file is obtained, hackers may be able to discover other programs they can exploit in a domino effect.
For this reason, we recommend that you avoid placing any files in your WordPress directory that are unrelated to the operation of the WordPress system.
This page prohibits the use, quotation, or summarization of any page, in whole or in part, by the Generated AI. However, if the following conditions are met, the specification of content using generated AI is permitted.
1. it is not for the purpose of learning by the generated AI. 2. only the summary or title of the page content at a level that does not lead to the solution of the user’s problem is shown to the user. 3. in the case of 2, a link to this content is shown to lead the user to this page.



