I have over 2000 posts and 95000 images on my WordPress. How can I clean up?

madison van rijn 4ta6nGC8cTA unsplash scaled Running WordPress
This article can be read in about 5 minutes.

Cleaning up a WordPress site with over 2,000 posts and 95,000 images can significantly improve performance and free up storage. Here’s a step-by-step guide to clean and optimize your WordPress site:

1. Backup Your Website

Before making any changes, create a complete backup of your site, including the database and files. Use plugins like UpdraftPlus or your hosting provider’s backup tools to ensure you can restore your site if something goes wrong.

2. Optimize the Database

Your database likely contains unnecessary data such as old revisions, spam comments, and orphaned metadata.

  • Delete Post Revisions: Limit the number of post revisions stored by adding this code to wp-config.php: phpdefine( 'WP_POST_REVISIONS', 5 ); Use plugins like WP-Sweep or WP-Optimize to delete existing revisions, auto-drafts, and transients.
  • Optimize Tables: Use phpMyAdmin or plugins like WP-Optimize to run the OPTIMIZE TABLE command on database tables. This reduces fragmentation and improves query performance.
  • Remove Unused Data: Delete spam comments, unapproved comments, pingbacks, trackbacks, and expired transients using plugins like WP-Sweep or WP-Optimize.

3. Clean Up the Media Library

With 95,000 images, unused media files are likely taking up significant space.

  • Identify Unused Media: Use plugins like Media Cleaner or Search & Replace Everything (Pro version) to scan for unused images.
  • Bulk Delete Unused Files: From the Media Library in the WordPress dashboard, use the “Bulk Select” option to delete multiple files at once.
  • Avoid Future Duplication: Install a plugin like Media Deduper to prevent duplicate uploads in the future.

4. Remove Unnecessary Plugins and Themes

Deactivate and delete unused plugins and themes to reduce clutter:

  • Go to Plugins > Installed Plugins, deactivate unused ones, and click “Delete.”
  • Similarly, remove old themes under Appearance > Themes.

5. Automate Cleanup

To maintain your site’s performance:

  • Schedule regular cleanups using tools like WP Rocket or WP-Optimize.
  • Automate tasks such as deleting spam comments and optimizing database tables weekly or monthly.

6. Compress Images

Reduce image file sizes using tools like:

  • Plugins: WP-Optimize (includes image compression) or Smush.
  • External tools: Compress images offline before uploading.

7. Monitor Performance

Regularly monitor your website’s speed using tools like Google PageSpeed Insights or GTmetrix after cleanup.

By following these steps systematically, you can declutter your WordPress site while improving its performance and user experience.

Comment

Donate with Cryptocurrency!

Copied title and URL