Skip to main content
Zass Tech
Free audit
Web Development5 min read

Backup Files in public_html: The Easiest Way to Leak a WordPress Site

By Shakh Farid·November 18, 2026·1 views
#WordPress Security#WooCommerce#Backups#Data Leak#Cloudflare

Short answer: Any file inside public_html can be downloaded if someone requests its name. That includes site archives (.zip, .tar.gz), database dumps (.sql, .sql.gz) and migration backups (.wpress). These usually contain wp-config.php with your database password and your customers' personal data. Keep backups outside the web folder, delete upload archives right after extracting them, and if one was exposed, move it out, purge your CDN cache and change the secrets it contained.

What I found, twice

On a WooCommerce store selling stationery in Bangladesh, I found exposed backups at two different moments.

During a security audit on the old host:

  • a 2.2 GB wp-content.zip in the web root;
  • two full-site .wpress backups from a migration plugin, each with the complete database (orders, names, phone numbers, addresses);
  • a zip of the custom theme and a developer notes file inside the theme folder.

All of them returned 200 OK to a plain request. The shop owner deleted them.

The day after migrating to a new host:

  • public_html.zip (2.3 GB), the archive uploaded to move the site, including wp-config.php;
  • a .sql.gz dump of the full database.

Same story: the files were extracted and imported, then simply left where they were.

Nobody planned any of this. Each file was created for a good reason (a backup, a migration, a handover) and forgotten afterwards. That's how it almost always happens.

Why it's so dangerous

  • No login needed. A browser or curl request to https://example.com/backup.zip is all it takes.
  • Bots look for them. Scanners routinely try names like backup.zip, site.zip, public_html.zip, wp-content.zip, database.sql and domain.com.zip.
  • One file leaks everything. wp-config.php has the database credentials and security salts. The SQL file has every customer record and the admin password hashes.
  • A CDN can keep it alive. Cloudflare caches archive types such as .zip and .gz by default. In my case, after I'd moved the SQL dump off the server, Cloudflare was still serving a cached copy (cf-cache-status: HIT) until I purged it.

How I check for exposed backups

From outside

Request the common names and look at the status codes. A 404 is good. A 200 with a large size is not.

for f in backup.zip site.zip public_html.zip wp-content.zip database.sql db.sql.gz; do
  curl -s -o /dev/null -w "$f %{http_code} %{size_download}\n" "https://example.com/$f"
done

Also check plugin backup folders such as wp-content/ai1wm-backups/ and wp-content/updraft/, and any .bak or .old copies of wp-config.php.

From the server

If you have SSH or a file manager, search the web folder directly:

find public_html -type f \( -iname "*.zip" -o -iname "*.tar*" -o -iname "*.gz" \
  -o -iname "*.sql" -o -iname "*.wpress" -o -iname "*.bak" \) -size +1M

Then review the list by hand. A plugin can legitimately ship a zip; a 2 GB archive in the web root is never legitimate.

🎯
Zass Tech service
Google Ads Management

Full-funnel campaign management, from setup to scaling spend profitably.

→

How I fixed it without losing anything

  1. Move, don't delete. I moved both files to a private folder outside public_html with permissions 700. They stopped being public immediately, and a copy was still available if the migration needed it. Delete them later, when you're sure.
  2. Purge the CDN. In Cloudflare, under Caching > Configuration > Custom Purge, I purged the exact URLs for both www and the root domain.
  3. Verify. Requesting each URL again returned 404 everywhere.
  4. Check who downloaded it. Look at the access logs for requests to those file names. In this case the files had been reachable for roughly twenty minutes after the domain started pointing at the new server, and the host didn't expose access logs over SSH, so I couldn't rule out a download completely.
  5. Rotate secrets if there's any doubt. Change the WordPress admin passwords, consider changing the database password (then update wp-config.php), and regenerate the security salts, which logs everyone out.

How to stop it from happening again

  • Keep backups out of the web root. Use your host's backup system, a folder above public_html, or off-site storage such as Google Drive or S3.
  • Delete upload archives right after extracting. Make it the last step of every migration checklist.
  • Clean up migration plugins. Once a migration is done, delete the plugin's backup files and the plugin itself.
  • Block archive downloads as a safety net. On Apache or LiteSpeed, an .htaccess rule stops these file types from being served even if one slips through:
<FilesMatch "\.(zip|tar|gz|tgz|sql|wpress|bak)$">
    Require all denied
</FilesMatch>

Don't use this if your shop sells downloadable zip files from inside the web folder, or adjust it to exclude that folder.

  • Repeat the outside check after every migration, restore or handover.

FAQ

Can people download files from my public_html folder?

Yes. Any file inside the web root can be requested by its URL unless the server is configured to block it. Directory listing being off doesn't help; it only hides the list, not the files.

Is it safe to keep WordPress backups on the same server?

Only outside the public web folder, with restricted permissions. A server failure or account compromise can still take them, so keep at least one copy off the server too.

What should I do if my database backup was publicly accessible?

Remove it from the web folder, purge any CDN cache, check access logs for downloads, and rotate secrets: admin passwords, the database password and WordPress salts. If customer data was likely downloaded, consider whether you need to inform customers.

Do .wpress backups contain the database?

Yes. All-in-One WP Migration's .wpress files contain the full site, including the database. Treat them like a database dump.


Real findings from a live Bangladeshi stationery e-commerce store, kept anonymous. If you're not sure what's sitting in your web folder, my web development service includes a security check.

📊
Zass Tech service
GA4 & GTM Setup

Clean, accurate tracking infrastructure that reports numbers you can trust.

→

Found this useful?

Share it with someone who's fighting the same tracking headaches.

Shakh Farid

Written by

Shakh Farid

Founder, Zass Tech

More from Shakh →