WordPress is very famous Content Management System. It is popular for Blog, behind its popularity functionality and user-friendly services are hidden. Here we are on this post to learn about ‘How to Cleanup the wp_options Table in WordPress’. Now I would like to tell you something about wp_options table, as like what is wp_options table in WordPress?
What is a wp_options table in WordPress?
First of I will tell you about tables. Yes, tables are consisting of row and column. But what its work in WordPress? Whenever we make a post, someone comment on our blog, we install any plugin/theme, all these are stored somewhere, that storage space is called database. A database may be made of many tables.
Tables are a separate location in the database to store specific information like post, user details etc. Now, what is a wp_options table in WP?
When we deactivate and remove already installed plugins and themes from our WordPress, all the information/data could not be removed. Some of the expired data reside in the wp_options table. If we have installed and removed many plugins and themes then there are many pieces of data reside in the wp_options table.
Those all data acquire space of database, it can lead to slow our blog. So to boost the speed of our blog we need to Cleanup wp_options table in WordPress.
Finding expired data in wp_option table
For removing expired data to make our blog faster, first you need to find all those expired data. So here, I am going to tell you how to find expired data from wp_options table in WordPress
- Go to cPanel and log in with your Username and Password.
- Click on phpMyAdmin
Now you need to enter an SQL query. Not to worry If you do not know the query and process. I am telling you.
- Click on SQL as you have seen in the below image and write down the following query in editor
SELECT * FROM `wp_options` WHERE `autoload` = ‘yes’
- You will get all the data from wp_options table
Your result will be in above format.
We have found the data from wp_options table. Now we need to cleanup the options table. You can manually cleanup the wp_options table by deleting one by one data from the table. You can delete data by click delete option.
However, when the expired data is more, then it will take more time to delete one by one manually. So for deleting all the unnecessary data, you have to write some SQL queries.
Let’s suppose I have installed Disqus plugin on my WordPress blog. I have deactivated that plugin and also removed from my blog. But when I applied query in wp_options table, I got many data related to Disqus has not been removed from a database.
Then for removing all those expired data (related to Disqus) from wp_options table, write the following SQL query in SQL editor (from phpMyAdmin: Refer to step 3)
WHERE `autoload` = ‘yes’
AND `option_name` LIKE ‘%disqus%
If you want to delete all the data related to any other plugin, then just change the name in above query at last line.
Example for Sumome
WHERE `autoload` = ‘yes’
AND `option_name` LIKE ‘%sumome%;
For deleting _transient entry from wp_options table
DELETE FROM `wp_options` WHERE `option_name` LIKE (‘_transient_%’);
Note: Before running this query it is recommended to find all the expired data related to that plugin by following the above method.
By executing queries, you can cleanup the options table in WordPress.
Here I have guided you to cleanup wp_options table in WordPress. It is very helpful to improve the loading speed of your site/blog. If you have any doubt regarding this process, feel free to ask me in the comment section.