Bluehost India Web Hosting Help
Clean up WordPress Meta Data
Overview
This article will explain how to clean up meta data in a WordPress database.
- What You Need
- Open The Database in phpMyAdmin
- Remove Rows With No ID
- Optimize The Post and Comment Tables
Backup your database before performing any of the steps in this article. You will be deleting data from the database. Accidentally deleting the wrong information may require restoring your database from a backup. If you are unsure how to backup your database please see How to Backup a MySQL Database
What You Need
To complete this tutorial, you will need to the following information:
- The username and password to your Bluehost India account.
- The name of your WordPress database. If you don't have this, please see How to find your WordPress Database
Open The Database in phpMyAdmin
- Login to your account at my.Bluehost.in
- Click Hosting at the top of your account.
- On the cPanel, under Databases, click phpMyAdmin
- Log in with your cPanel username and password.
- On the left side, click on your wordpress database.
Remove Rows With No ID
- Note the prefix attached to your database tables. In our example database, all table names begin with wp_rfrz_. This is our database prefix. Yours will differ.
- Click on the SQL tab.
Comment Meta Data
These steps explain how to clear the comment meta data.
- Copy and paste this code into the textbox:
SELECT * FROM your_prefixcommentmeta WHERE comment_id NOT IN ( SELECT comment_id FROM your_prefix_comments ); DELETE FROM your_prefix_commentmeta WHERE comment_id NOT IN ( SELECT comment_id FROM your_prefix_comments ); SELECT * FROM your_prefix_commentmeta WHERE meta_key LIKE '%akismet%'; DELETE FROM your_prefix_commentmeta WHERE meta_key LIKE '%akismet%';
- Replace your_prefix_ with your database prefix.
- Click the go button.
Post Meta Data
These steps explain how to clear the post meta data.
- Copy and paste this code into the textbox:
SELECT * FROM your_prefix_postmeta pm LEFT JOIN your_prefix_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL; DELETE pm FROM wp_postmeta pm LEFT JOIN your_prefix__posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;
- Replace your_prefix_ with your database prefix.
- Click the go button.
Optimize The Post and Comment Tables
- At the top of phpMyAdmin, click the structure tab.
- Select the comments, commentmeta, posts, and postmeta tables.
- In the drop down menu labeled With Selected, choose Optimize Table.
The tables should now have unnecessary meta data removed. If you encounter any issues with the website after this procedure, consider restoring your database using your backup.
Recommended Help Content
WordPress Install Without Automatic Database Creation
This article explains how to install WordPress when Mojo is unable to create the database automatically.
How To Find Your WordPress Database
This article explains how to find the database in use by a WordPress site.
How To Migrate An Existing Wordpress.com Site
If you have a WordPress blog hosted on WordPress.com, you can easily export it and import it to WordPress that is installed on your hosting account with bluehost_in. Login to the WordPress Data
Related Help Content
How to Create and Delete MySQL Databases and Users
This article will explain MySQL database and user creation and deletion, and explain how to assign a user to a database.
How to change the WordPress URL
This article will explain how to change your WordPress Urls
Change WordPress URL's With WordPress Tools
This article will explain how to change the Site URL or Home URL setting in WordPress. This may be useful if you have moved your WordPress site or are planning to move your WordPress site.
Login to WordPress with WordPress Tools
This article will explain how to login to a WordPress site using WordPress tools.
Core Files Warning In WordPress Tools
This article will explain why you see "Your WordPress site appears to be infected with malware. Please update to remedy this problem."
How To Login To WordPress Site - WP Admin Access
This article will explain how to login to a website created with WordPress.
How To Reset MySQL Database User & Password
This article will explain how to change the password for a database in the event that the original password is lost.
Managing Themes and Plugins with WordPress Tools
This article will explain how to manage WordPress plugins and themes using WordPress Tools.