There are multiple ways to optimize the webserver and also WordPress for speed and security. One way to optimize the database and clean up obsolete data is by using the WP-Optimize plugin.
This plugin recently also added the feature to compress and serve optimize media images.
In this article, we are going to learn how to set up and schedule the WP-Optimize plugin for automated MySQL database clean up and also compress the image size.
If you’re following us, this is the sixth article and video demo in the #WordPressBlog series. We previously published about WordPress Fail2ban plugin setup for improving security and protection from brute force attacks.
Without further ado, let’s dive into setting up WP-Optimize —
Install WP-Optimize Plugin in WordPress
Let start off with installing the WP-Optimize plugin in our WordPress CMS. Follow the steps to install WP-Optimize:
- Login to WordPress Dashboard
- Navigate to Add New under Plugins menu
- Search and Install WP-Optimize plugin from WordPress repository
- Activate the Plugin
- Now you’ll see a new menu added into your WordPress menu options — WP-Optimize
Click on the menu to navigate to Database Optimization.
Database Optimization and Clean-up
This is the first menu option to manually clean up the database. You can view all the existing database tables that can be optimized. Just hit on the [Run Optimization] command button again each action.
You can also select the checkbox against each command that you want to run and run the optimization in a go. Say for example if I want to clean up post revisions, delete the trashed post, and
spam comments. Then need to enable the checkboxes against the same and hit on [Run all selected optmization] command button.
The next tab under the Database menu is to view all the ‘Tables’ in our MySQL database installation against WordPress. This tab will display all the tables that are generated due to plugins and options that we have installed in our WordPress.
If there are any obsolete databases from uninstalled plugins, you can also delete the entire table from this tab.
Image Optimization Setup
As I mentioned, this was the new feature added into WP-Optimize and I think it’s a really great addition. I was using the WP reSmush.it plugin to compress and optimize images.
Now, this plugin has added the feature to use the same reSmush.it API to compress the images, I no longer need the extra plugin. Hence, I uninstalled the plugin and set up the image file optimization with the WP-Optimize plugin itself.
Navigate to the Images menu under WP-Optimize and setup per your needs. My current setup looks like below:
This Image Optimization set up helps with:
- Automatically Optimize the Images when uploaded — generally take 30 mins after uploading
- Show the compression size and total file size saved after compression
- Optimize and compress the image losslessly to retain the maximum details and EXIP data
- And lastly, retain the original image backup to revert back if anything goes wrong
As you can see, there are two compression services available: reSmush.it & Nitrosmush. I never tested how much compression different each makes, however, I’m pretty happy with reSmush.it service.
We can also view all the existing images that are pending for compression. You can select your existing media library and bulk optimize from this tab.
Scheduling a Clean-up in WP-Optimize
The automatic clean-up scheduling option is available under the Settings menu. We can also select the option to retain the data up to a certain time period like 1 week or 2 weeks etc. Once the retention period is surpassed, the data is can be deleted with manual clean up or scheduling options.
You can schedule the clean-up for database table for daily, weekly, fortnightly, and monthly. And also select the database tables that you need to clean-up per schedule. Though the scheduling feature is BETA, it works flawlessly and helps in auto-maintenance of WordPress DB.
Video demo of WP-Optimize Plugin Setting
Watch the setup by step video tutorial of WP-Optimize set up for database and image optimization. There are also options to enable/disable the comments as well as trackbacks under the Settings tab.
I hope you liked the video, please subscribe to the youtube channel for more.
What’s Next in the #WordPressBlog series?
Now that we’ve learned how to optimize the WordPress database and media library. Next, we are going to learn how to set up the free WordPress Photon for images CDN without using the JetPack plugin.
If you've any thoughts on WP-Optimize: Free Database Clean-up & Image Optimization Plugin, then feel free to drop in below comment box. Also, please subscribe to our BrowserHow YouTube channel for amazing videos tips. Cheers!