WordPress is a rock solid web publishing platform, but it needs regular maintenance or it becomes vulnerable and slow. Firstly, there are some WordPress Security Best Practices that you need to follow in order to keep your WordPress powered website safe. Then there are other things that you can do to clean up the mess accumulated over the months of publishing. In this post, we will discuss tidying up your wordpress installation.
Clean up Unwanted Drafts
If you run a busy website or a site with multiple authors, you will have several unpublished posts in drafts. There will be posts that were started but never completed, posts that were later changed into something else. This is the clutter made during the creation of new content. A lot of this clutter can be made usable, rest of them are just taking space and creating a messy look. Cleaning up drafts that you no longer need will keep your posts area cleaner and more organized. Revisiting drafts will also give you a chance to find new post ideas or give rebirth to an untested idea.
Delete Spam and Trash Comments
As your website gets older and starts building a reputation around the web, you start getting more and more spam comments. Akismet catches a lot of spam and stores them in your database for your review. There are also comments that got away from Akismet and are awaiting moderation, then there are comments that you trashed. These comments are just taking space, cleaning them would make it easier for you to review the discussions on your website, it will also make your comments admin area look cleaner. I personally keep this area clean as comments are a very helpful resource for me to look at and think about what I should write next.
Manage Categories and Tags
Categories and Tags were so badly misused by people who thought these are some kind of tools to tell Search Engines what a website is about. Well after the recent updates to Google Search, many website owners and bloggers have recognized that this is not the case. However, most busy websites have many categories with no posts, irrelevant tags, posts with no categories or tags, and so on. Open your categories and tags and delete categories/tags with no posts or if you remember some post that might be relevant to that category/tag edit those posts and properly categorize them.
While you are managing your tags and categories you would notice that you can add descriptions for your categories and tags. A lot of users don’t take advantage of this search engine friendly feature. Unfortunately, many WordPress theme developers also don’t take advantage of this. I think adding description below category title on categories templates would make category views useful for visitors as well as search engines.
Managing categories/tags will make your website well organized. It will also make it easier for visitors to browse content on your website. Browsing through your posts, categories, and tags will also give you some nice post ideas.
Your database size isn’t this huge because of your lengthy posts, there is data stored by plugins and the default WordPress settings that is useless and you probably don’t need it at all. Some of this data can be easily removed without affecting anything on your website. Removing this data can potentially make your database queries run faster, and would definitely reduce the size of your database backups.
Warning: Please be careful while updating your database. Make sure you have made a complete backup of your WordPress database before updating it.
Clean up the Fetched Feed Data
WordPress comes with a built-in mechanism to fetch RSS feeds and display them in widgets. On a default WordPress installation, you would see this in action on your admin dashboard where it automatically fetches the feeds for WordPress Development Blog and WordPress Planet. The data for these feeds is stored in your database. It is quite harmless but you can clean it up if you want.
DELETE FROM `wp_options` WHERE `option_name` LIKE (‘_transient%_feed_%’)
Clean up Unwanted Database Tables Created by Plugins
I love trying new plugins and themes, some of them become a permanent part of that setup and some don’t. Some plugins I deactivate and delete while others are left activated doing nothing (I know that’s very irresponsible of me). A lot of WordPress plugins and themes store data in your database and if you are like me then over the time you will have several entries and tables in your database that are totally useless. Any good plugin author would include the removal of these entries into their uninstall script or would at least provide you instructions on how to remove them. Unfortunately, some plugin authors choose not to do so. Theme developers prefer not to uninstall that data because it may contain your widgets, header, background or navigational menu settings.
To remove unwanted plugin and theme data from your database, browse it to find such entries and tables and delete them. Make sure you first deactivate and delete the plugins and themes you don’t need. Also I can not stress this enough, make a backup of your database before doing anything. The first place you would want to look at is your
wp_options table in your database. Browse the table carefully and see if you can find entries related to an inactive plugin.
Apart from wp_options, some plugins will also create their own tables to store data. These will be quite easy to identify among your WordPress tables.
Cleanup Post Revisions
By default, WordPress saves posts revisions, these are auto-save versions of your posts stored in your database. If you have hundereds of posts on your blog than each of them would have several revisions stored in your database. Deleting these revisions would reduce the size of your backup file and would probably make your queries run a little faster. Running the following query on your WordPress database you can easily remove revisions.
DELETE FROM `wp_posts` WHERE `post_type` = ‘revision’;
I don’t think that turning off revisions on a multi-author website is a good idea. There are other ways to manage revisions to make sure that there are not too many revisions in the database. But if you insist on turning them off altogether then all you need to do is to add this line to your wp-config.php file:
Deleting Unwanted Files in Media Library
Images and files uploaded to your server while writing posts or separately, are managed in the Media Library. Now there are two kind of files that you would want to delete. Firstly you would need to find the files that are not attached to a post and just lying there because you or some other user on your website uploaded them and didn’t use them anywhere. On the Media Screen, click on Unattached and WordPress will display files that are not attached to any post. Please browse the list once before deleting these files, there might be image files used in your themes and widgets.
Secondly, you can choose to delete different sizes of the images stored on your server. By default WordPress saves an image in three sizes; full, medium, and thumbnail. However, make sure you are not using those sizes anywhere on your website. By default WordPress saves an image in three sizes full size, medium size and thumbnail.
WordPress requires maintenance just like a good car. It would run faster and consume less resources if maintained and optimized regularly.