BACKTips for looking after a WordPress MySQL database
Published on Wednesday, April 04, 2012 Comment(s): 0
If you've run a WordPress website on your own hosting for a number of years, else have built up a sizeable amount of content, chances are your WordPress MySQL database requires maintenance, as well as possibly being too large and requiring repairs.
Hire our team of website developers in the UK, to improve your website.
Just like other types of databases, it is incredibly easy for the WordPress MySQL database to become bloated and disorganised. The end result is that it could be slowing down your website, which could in turn impact the visitor experience and search engine placement. It isn't just human visitors who don't like slow websites, as search engines also pay attention to the speed of a website. So it is important you optimise the MySQL database.
Also your enlarged and / or disorganised MySQL database could be hiding a problem, such as the 'wp_commentmeta' table spiralling out of control, taking up valuable space. This article tells you how to analyse your MySQL database, and optimise the database for improved performance.
Note: Before you make any changes to your MySQL database, you need to perform a backup of the database, which you should be doing automatically already. However make sure you make a fresh backup right now, so that you have a recent version to fall back upon, should a problem arise.
Step 1 – Repair the tables.
Using phpMyAdmin you should repair any MySQL tables. This only takes a few moments and we've already covered how to make an necessary repairs in part one of our WordPress MySQL Database Help guide.
Step 2 – Clean-up and optimise the MySQL database.
There are plugins such as 'WP-Optimize' which can help you clean up the MySQL database. Areas that 'WP-Optimize' covers are:
- Post revisions and automatic saved draft posts.
- Removal of spam and unapproved comments.
- Optimise the WordPress MySQL database tables.
All you need to do is download the plugin, activate and then select the tasks you wish it to perform. However do not use the plugin before checking whether there are any repairs required, as mentioned in step 1.
Step 3 – Check for abnormal table sizes.
The plugin WP-Optimize not only performs tasks to help you clean up the database, but like phpMyAdmin it can tell you the sizes of the individual tables. A good example is discovering you have a table that appears to be too large, such as the wp_commentmeta table, which the plugin Askimet uses. It might be the situation that you can safely run a MySQL query in phpMyAdmin to sort out the issue. Before you make any changes to a MySQL table, make sure you perform a backup.
In the case of the wp_commentmeta table being too large, it could be Askimet hasn't removed data from the database, instead enlarging the table, it isn't unknown for this to make a 5Mb database 20-30Mb or larger! So if you have that particular issue, please see this support thread, which provides a query you can run to fix the problem, but obviously you run this at your own risk, and you must make sure you've made repairs and performed backups first.
You need to make sure you regularly check whether your MySQL database needs repairing, and whether it needs cleaning, as well as optimising and watching for issues. Not only could it save you some serious hassle, but also help your search engine placement, and allow visitors to enjoy a faster browsing experience.
If you require website design and development services, then you should get in touch with Geonet Solutions.
Hire our web designers and developers, to move your website project forward.