Hunter WebDev Logo
  • Home
  • Blog
  • Services
    • Website Customization
    • Search Engine Optimization
    • Plugin Development
    • PSD to HTML to WordPress
  • Request a Quote
  • Contact
  • Home
  • Blog
  • Services
    • Website Customization
    • Search Engine Optimization
    • Plugin Development
    • PSD to HTML to WordPress
  • Request a Quote
  • Contact

Blog

Deleting Orphaned Post Meta in WordPress

Published On - November 2, 2018

Dan Website Speed, WordPress

If over the course of your WordPress sites lifespan you’ve activated and deactivated plugins that either add custom post types or add additional options to post types there is a very good chance that your site contains orphaned post meta. By orphaned we mean in the sense that their parent post has been deleted but all of the associated post meta still remains.

These orphaned post meta can pile up and cause unnecessary overhead within your database, if you have access to phpMyAdmin you can run this query to help remove them:

 

If you don’t have access to phpMyAdmin on your website you can always try a plugin like Advanced Database Cleaner. This will also allow you to clean up additional areas within the database.

Note: The above SQL query assumes that your websites database prefix is “wp”, if it isn’t then you will need to change the terms ‘wp_postmeta’ and ‘wp_posts’ to match your prefix. If your site uses ‘hwd’ as the prefix the terms would be: ‘hwd_postmeta’ and ‘hwd_posts’.

 

If you ever need any assistance optimizing your website performance or managing your database, please do not hesitate to contact us.

Tags: post meta sql WordPress
Previous Post Why You Should Have a Well-Designed Website
Next Post Easiest Way to Search And Replace a WordPress Site

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Latest Posts

  • Disable WordPress Fatal Error Handler

    13 July, 2020

  • WordPress get post meta shortcode

    Get Post Meta Using a Custom Shortcode

    3 September, 2019

  • Firefox Console

    How to Find Your Browsers Console

    29 August, 2019

  • Contact Form 7 Modified Plugin Banner

    Add Contact Form 7 Mail Tags Quickly

    29 August, 2019

  • Easiest Way to Search And Replace a WordPress Site

    3 January, 2019

Contact Us
  • Phone: +1 (833) 420-0650
  • Email: hello@hunterwebdev.io

Follow Us On

Related Articles
Blank Image
Disable WordPress Fatal Error Handler

July 13, 2020

Blank Image
Get Post Meta Using a Custom Shortcode

September 3, 2019

Blank Image
Add Contact Form 7 Mail Tags Quickly

August 29, 2019

Hunter WebDev

Featured Services
  • Website Customization
  • Plugin Development
  • PSD to HTML to WordPress
  • Search Engine Optimization
Latest Blog Posts
  • Disable WordPress Fatal Error Handler
  • Get Post Meta Using a Custom Shortcode
  • Add Contact Form 7 Mail Tags Quickly
  • How to Find Your Browsers Console
  • Easiest Way to Search And Replace a WordPress Site
Contact Us

Phone: +1 (833) 420-0650

Email: hello@hunterwebdev.io

© Hunter WebDev 2020