After using wordpress for some time, you will notice that the wp_postmeta table is getting bigger.

You can reduce ‘overhead’ by optimizing and clean up the wp_postmeta table by:

  1. Log in to PhpMyAdmin.
  2. Click on the database.
  3. Click on wp_postmeta.
  4. Click on SQL and run the following query:
SELECT * FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;
DELETE pm FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL;

Hit GO.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s