Just about everything that is related to the content on your WordPress website is stored in a database. For now, I will refer to this as your WordPress database. All your Posts, your Reader comments, your pages, etc. are saved in a database. Every once in a while, the database may run slower than you want it to. When that happens, it is time for a basic tune-up on your website.
To perform this tune-up, you will have to use a program called phpMyAdmin. This is available to you from within your cPanel on your hosting account. In case you are wondering, PHP is the language that is used to create WordPress.
Note: Of course, always back up your database BEFORE you make any sort of changes to it. Also, make sure you can RESTORE your database if you have to revert back to a previous version. A back up is NO good if you cannot get the data back!
Let’s get started, shall we?
- Log into your cPanel and look for the section titled, Databases.
- Click on phpMyAdmin.
- On the left will be a list of databases. Select the one to repair/optimize (if you only have one website with WordPress installed, it will be the only entry). To select it, click on the name.
- This will load all of the tables in your database into the right side. At the bottom of this list, check the “Check All” checkbox/link at the bottom of the list.
- Just to the right of the Check All link, select the “Repair” option in the drop-down list.
- This will list all the tables, with “OK” listed next to them. When this is done, look up to the top of the page and click on the “Structure” tab.
- Once the process has finished the page will revert back to step 4.
- Click “Check All” again, and then choose “Optimize” in the drop-down menu.
That is all you have to do – the process is done! Many MySQL errors can be fixed by this process. It is recommended to perform these steps frequently to keep any database in good condition.
If you are more technical (and want to know what just happened), read on. If not, just rest assured that your work here is done!
So, what just happened? Well, the Optimize Table command was run on all the tables. According to the official mySQL manual,
OPTIMIZE TABLE should be used if you have deleted a large part of a table or if you have made many changes to a table with variable-length rows (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted rows are maintained in a linked list and subsequent INSERT operations reuse old row positions. You can use OPTIMIZE TABLE to reclaim the unused space and to defragment the data file. After extensive changes to a table, this statement may also improve the performance of statements that use the table, sometimes significantly.
Are you glad you asked?
denny hagel says
Valuable info! Thanks for sharing!
Hughie Bagnell says
Great technical information Paul! Thank you for sharing…Hughie