q292u

WordPress Database – Delete Orphaned Postmeta

Wordpress Technical

Delete Orphaned Postmeta

After deleting posts using SQL, you will be left with (potentially a LOT) of orphaned postmeta records. You don’t want that! It wastes space and clogs up site performance. Get rid!

From PLESK or CPANEL database web admin:

DELETE
FROM wp_postmeta
WHERE post_id NOT
IN (
SELECT ID
FROM wp_posts
);

** BACKUP YOUR DATABASE FIRST!

Please note: You should NEVER leave your tables with the default “wp_” prefix. Or have a user called “admin”, or a user with id=1. That’s just for start!
Let us secure your WordPress site for you:
http://www.q292u.com/services/secure-your-wordpress-site-our-new-fiverr-gig

Exit mobile version