If you have been using WordPress for a while, then there is a good chance that you’ll need WP-Sweep Plugin Tool to clean up your WordPress site. Doing regular clean-ups allows you to reduce your database size which means quicker and smaller backup files. Unfortunately, as you continue to use WordPress, your database accumulates a lot of extra data.
Such data includes revisions, spam comments, trashed comments, data from plugins you are no longer using, and more. Removing all this unnecessary data can significantly reduce your database size. This WordPress plugin uses proper WordPress delete functions as much as possible. Instead of running direct delete MySQL queries while speeding up your backup process.
And it can also add minor performance improvements as well. The main aim of WordPress Database Optimization is to improve website performance by removing unwanted data and reducing the database size. The process of optimizing the WordPress database is not hard. The WordPress Database Optimization process is as important as optimizing the website’s front-end data.
Related Topic: How To Use FTP To Upload WordPress Files In Simple Steps
Overall, this helps in improving database performance by responding faster to database queries. A new website with a default WordPress setup is having a comment set of tables. As soon as we start installing themes and plugins, the number of database tables keeps on rising and the database keeps on getting larger.
Even if we remove or deactivate some WordPress plugins, it does not remove tables from the database. In that case, once the database has grown larger it requires optimization and cleanups to keep the website functioning smoothly. Before we proceed, make sure that you as well learn more about how to optimize the WordPress database in detail later on.
What Is WP-Sweep Plugin?
The WP-Sweep Plugin is a WordPress database tool that uses proper delete functions properly instead of running direct delete MySQL queries. Eventually, even if you haven’t faced website error issues, it’s so important that you clean up your WordPress database on a regular interval.
This could be a week or a month. Depending upon how regular you post or how big your WordPress blog is. Basically, WordPress software is designed for everyone! Whereby, it emphasizes accessibility, performance, security, and ease of use.
My belief is that great software such as WordPress should work with minimum setup. So that you can focus on sharing your story, product, or services freely. Fortunately, the basic WordPress software (learn more) is simple and predictable so you can easily get started.
Related Topic: How WordPress Caching Is Done | Top 10 Webster Plugins
Not forgetting, it also offers powerful features for growth and success. I also believe in democratizing publishing and the freedoms that come with open source. Supporting this idea is a large community of people collaborating on and contributing to this project.
Not only that but the WordPress community is so welcoming and inclusive. Unlike all other CMS software combined. The WordPress contributors’ passion drives the success of WordPress which, in turn, helps you reach your goals.
As a result, among many others, that’s how the WP-Sweep Plugin comes to your rescue. As a webmaster, at times, you may either experience “an error connecting database,” “a WordPress site that’s too slow,” or even just “A web host that sucks.”
Related Topic: Which CMS Software Is The Best? Topmost 5 Web Builders
That said, how many times have you faced a similar problem as above? At times, we’ve even seen other WordPress webmasters complaining about such issues too. There could be multiple reasons for the above issue. And one of them is the database of your WordPress site.
As an example, here at jmexclusives, we do database cleanup once every month. Especially, for those who add and delete many new WordPress plugins, cleaning up your database will significantly improve your WordPress blog and hosting performance. So, you too can calculate your best optimum interval according to your blogging (blog articles) frequency.
How The WP-Sweep Plugin Really Works Plus Installation Steps
There’re so many benefits of using the WP-Sweep plugin. For instance, consider the years of creating new content, changing themes, and adding and removing plugins. As such, a WordPress installation can become littered with unused, orphaned, and duplicated data. Not every plugin properly extricates itself and its data from your site when you uninstall it.
Technically, the new WP-Sweep plugin was designed by Lester Chan to perform housekeeping on WordPress installations. Not to mention, that Chan is quite a prolific plugin developer, who created his first plugin in 2003 — this is shortly after WordPress was forked from B2 to become one of the best CMS — he now has 24+ plugins listed in the WordPress directory.
Related Topic: Tags & Categories | WordPress SEO Master Best Practices
The WP-Sweep plugin has a very distinguishing characteristic in that it uses proper WordPress delete functions as much as possible. Instead of running direct delete MySQL queries. This method is in direct contrast to similarly purposed plugins such as WP-Optimize, which has been downloaded more than 1.5 million times.
The plugin uses very great WordPress delete functions. Such as wp_delete_post_revision()
, delete_post_meta()
, wp_delete_comment()
, etc. Whilst, allowing you to clean up the database. It can perform a variety of sweeps.
Such as the following:
- Deleted comments,
- Revisions & Auto drafts,
- Spammed comments & Comments meta,
- Unapproved comments & Orphaned post meta,
- Orphaned User Meta & Orphan Term Relationships,
- Unused Terms, Duplicated Post Meta & Comment Meta,
- Duplicated User Meta & Transient Options, etc.
Now that you have that in mind, the next thing is to know how to download & install the WordPress WP-Sweep Plugin in simple steps. But, if you want to download and use the plugin to clean up your website, you are strongly advised to make a backup of your database first. Why? Simply, because the actions it performs are irreversible.
With that in mind, let’s now learn how to install and activate the WP-Sweep Plugin on your WordPress website in simple steps. By all means, the WP-Sweep Plugin can be found under the Tools menu after you install it. Whereby, you can either download the installation file here or rather, search it from your WordPress plugins directory or just follow these steps.
Method One: Direct Manual Installation:
- First, download the installation file on your ‘Desktop‘ home screen,
- Secondly, head on to your WordPress dashboard,
- Click on the ‘Add New Plugin‘ option, and then click to locate your file,
- Thereafter, hit the ‘Upload‘ button, and then WordPress will ‘Unzip‘ it on your site,
- The next step is to ‘Install‘ and ‘Activate‘ it. That’s it! You’re ready to use it.
You’ll now be able to use the WP-Sweep Plugin options as instructed via Github in detail.
The delete functions used include:
- wp_delete_post_revision()
- wp_delete_post()
- wp_delete_comment()
- delete_post_meta()
- delete_comment_meta()
- delete_user_meta()
- delete_term_meta()
- wp_remove_object_terms()
- wp_delete_term()
- delete_transient()
- delete_site_transient()
Method Two: WordPress Directory Installation:
- By the same token, head over to your WordPress plugins directory,
- Then again, type the word ‘WP-Sweep Plugin‘ and hit the ‘Search‘ button,
- You’ll see a full list of plugins but only the ‘WP-Sweep Plugin’ is your center of interest.
- Click on the ‘Install‘ button and then ‘Activate‘ it.
- That’s it! You’re ready to use it.
Of course, you can check out WP-Sweep on WordPress.org and favorite it for the next time you need to do some database housekeeping. In short, we can sum up everything and simply say:
To Install WordPress WP-Sweep Plugin:
- Upload
wp-sweep
folder to the/wp-content/plugins/
directory - Activate the
WP-Sweep
plugin through the ‘Plugins’ menu in WordPress - You can access
WP-Sweep
viaWP-Admin -> Tools -> Sweep
Upon activation, simply go to Tools » Sweep to clean up your WordPress database. This plugin will analyze your WordPress database and show you a report of how much clutter you can clean. The sweep report is divided into different sections. For your posts, comments, user meta, options, terms, and the database optimize features.
On the same note, you can even scroll further down and you’ll see reports for comments, users, terms, and options. Certain sweeps have extra instructions to consider before using. For example, Unused Terms: so, “note that some unused terms might belong to draft posts that have not been published yet.” Therefore, only sweep this when you do not have any draft posts.
In fact, after our SEO webmasters tested the plugin, they reported a savings of 23.5% on database size. They also reported a bug, which Chan (the plugin builder) promptly fixed. And we can clearly say, in general, that this plugin uses proper WordPress delete functions as much as possible instead of running direct delete MySQL queries.
WP-Sweep WP REST API Endpoints Include:
-
GET /wp-json/sweep/v1/count/<Name>
. Get the number of items that we will be sweeping. -
GET /wp-json/sweep/v1/details/<Name>
. Get the details of the items that we will be sweeping. -
DELETE /wp-json/sweep/v1/sweep/<Name>
. Runs sweep for that particular item.
WP-Sweep WP-CLI Commands
-
wp sweep --all
. Runs sweep for all items. -
wp sweep <Name>
. Runs sweep for that particular item. -
wp sweep <Name1> <Name2>
. Run sweep for the selected items.
It’s important to realize, that WP-Sweep Plugin is not compatible with some other existing WordPress plugins though.
The incompatible plugins are:
- WPML
- Polylang
- MailPress
- Meta Slider
- Viba Portfolio
- Custom Fonts
- Asgaros Forum
- Slider Revolution
- Elementor Popup Builder
Be that as it may, as webmasters, we always pity the people who complain about having an unexpectedly bigger size database on their websites. Many people claim to have a database of 50 MB when the number of blog posts is only 60.
Usually, we often recommend that it shouldn’t exceed 15 MB when having 500 blog posts. Is that surprising? Well, it should be. So, go ahead and get the WordPress Plugin for your site to solve all your database-related issues.
What You Should Know As You Clean Up With WP-Sweep Plugin
As I said, this is one of those plugins which doesn’t require any technical skills. And even the most basic WordPress users can clean and optimize their blog database in a few minutes. Unlike other plugins, this plugin comes with a single button for cleaning up all or individual options as mentioned.
With that in mind, if you haven’t cleaned up your blog in a while, take a few minutes, and let it get done as you are reading how to use this plugin. Moreover, this page is structured in a very clever manner. While helping you delete individual tables according to the usage.
Or you can go to the bottom and click ‘Sweep All‘, to clean up your database with a single click. However, in the Term sweep section, if you see there is a huge number of Unused terms, Sweep it only when you don’t have any draft posts.
Transient Options
In general, transient options are like a basic cache system used by WordPress. Clearing these options before a backup will help to save space in your backup files. After all, you should not lose anything by removing the transient options. Why? Well, since that system is built to rebuild the cache of transient options after a specified period of time if they do not exist.
You can read and learn more about Transients API in detail first. For you to understand how transient options work further. Duplicates in either the Post Meta or User Meta tables are known as Duplicated Post Meta.
oEmbed Cache
WordPress uses oEmbed to grab the embed code for various embeddable content such as YouTube and Vimeo videos. Sometimes, though, the embed code that your WordPress installation receives through oEmbed is damaged. In this case, the only real solution is to clear your oEmbed cache. So that WordPress knows to try to fetch new embed code.
Once you’re done sweeping all the options that you want to clean, click on the sweep in “Database Sweep.” It’ll, eventually, optimize your WordPress database. This is an important step after you’re done cleaning your WordPress blog database.
MySQL Delete Statement
Overall, WP-Sweep is one of those plugins which you or anyone can use without technical knowledge. It saves you from all technical jargon! While making the cleaning up process of your WordPress database so easy.
But, for your information, you can also use MySQL Delete as an alternative option to WP-Sweep Plugin too. To delete data from a table, you use the MySQL DELETE
statement. The following illustrates the syntax of the DELETE
statement:
DELETE FROM table name
WHERE condition;
Code language: SQL (Structured Query Language) (SQL)
In this statement:
- First, specify the ‘Table‘ from which you delete data.
- Second, use a condition to specify which rows to delete in the ‘WHERE‘ clause. The
DELETE
statement will delete rows that match the condition,
But, it’s important to note, that the ‘WHERE‘ clause is optional. Not to mention, if you omit the WHERE
clause, the DELETE
statement will delete all rows in the table. Besides deleting data from a table, the ‘DELETE‘ statement returns the number of deleted rows.
To delete data from multiple tables using a single ‘DELETE‘ statement, you use the DELETE JOIN
statement. While on the other hand, to delete all rows in a table without the need of knowing how many rows were deleted, you should use the TRUNCATE TABLE
statement to get better performance.
For a table that has a foreign key constraint, when you delete rows from the parent table, the rows in the child table will be deleted automatically. By using the ON DELETE CASCADE
option. For more, in this article, you can see some MySQL DELETE examples.
How To Use phpMyAdmin For WordPress Database Optimization
By definition, phpMyAdmin (https://www.phpmyadmin.net/) is an open-source tool that helps in creating, editing, managing, and deleting databases for a website. It is a graphical interface that helps to manage the MySQL database.
After using WordPress for a while database of your website becomes fragmented. It will increase the query execution time because of memory overheads. You can optimize the database using a single command or say by following a few steps from phpMyAdmin.
These are steps to optimize database tables:
- Go to phpMyAdmin,
- Select the ‘Database‘ you like to optimize,
- On the table listing page, click on “Check All” to select all tables,
- From the “With Selected” drop-down, choose Optimize table,
At most, the database tables will be optimized by de-fragmenting tables.
In addition, there’re a few configuration options to remove unnecessary data you can use. And now, alongside WordPress Database Optimization through phpMyAdmin, you can also optimize the database by changing constant values in the WordPress configuration file (wp-config.php):
1. Auto-saves:
WordPress saves pages and posts automatically after a specified duration. It means whenever you are writing an article WordPress auto-saves it after the number of seconds specified. You can add the following line in wp-config.php with the desired interval to increase the duration.
define( ‘AUTOSAVE_INTERVAL’, 300);
2. Empty Trash:
WordPress by default stores deleted/removed items for 30 days in the database. You can add the following line in wp-config.php with fewer days to empty the trash automatically. This will help in decreasing query execution time.
define( ‘EMPTY_TRASH_DAYS’, 5);
3. Revision Numbers:
One of the most useful features of WordPress is revisions. It helps bloggers in loading a previous version of the article in case of disaster. Although there is no limit on how many revisions can be stored in the database, it can be 5, 10, or even 30. You can limit the number of revisions by placing the following line in wp-config.php.
define( ‘WP_POST_REVISIONS’, 5);
Takeaway Notes:
As you know, the user experience is the first thing that impacts the growth of your website. As well as the page loading time of your website which’s directly proportional to user engagement. Oftentimes, WordPress users ignore database optimization. Using a CDN (like Cloudflare), caching plugin, code minifying, and other tricks can’t just work like magic.
More so, that’s if you don’t focus on deleting the extra database tables. And that’s where WP-Sweep Plugin comes in handy. Keep in mind, that together with his team, its developer — Chan — plans to continue to develop the plugin and is even considering adding unused options to the sweeps in a future version. So stay right ahead and enjoy all its benefits as they come.
Additionally, there’re other plugins that will provide your site with a wide wide range of options too. To equally help in optimizing your WordPress website database very well. Below is a list of such other plugins that can, basically, help in optimizing your overall WordPress website database without a glitch. You can try some of them and share your feedback later on…
They include:
In reality, the database optimization process seems a bit complex and time-consuming process but a number of free plugins available in the market can make this process pretty much easier. With ready-made WordPress plugins, you don’t have to manually go through database tables. Make sure that you also learn about Website Design From Scratch if you are just getting started.
Finally, if you’ll need more support, you can always Consult Us and let us know how we can help you. After all, you’re also welcome to share your additional thoughts, contributions, suggestions, or even questions in our comments section. Not forgetting, you can also Donate in order to support what we do as well as to motivate our creative content writers for their good work.
Get Free Updates
Notice: All content on this website including text, graphics, images, and other material is intended for general information only. Thus, this content does not apply to any specific context or condition. It is not a substitute for any licensed professional work. Be that as it may, please feel free to collaborate with us through blog posting or link placement partnership to showcase brand, business, or product.