Skip to content
wpbeaches
  • Home
  • About
  • Services
  • Work
    • Template Library
    • Web Development
    • Portfolio
  • Contact
  • Blog
    • ACF
    • Beaver
      • Beaver Builder
      • Beaver Theme
      • Beaver Themer
    • Genesis
    • jQuery
    • macOS
    • WordPress
    • WooCommerce

Optimise wp_postmeta table and remove custom fields meta keys

October 24, 2017 - 2 Comments

Overtime a wp_postmeta WordPress database table may become bloated and use redundant custom field meta_keys. The table may have thousands of rows worth of dead data such as old custom fields.

You can remove these keys quite quickly in the MySQL database once you know the key format, I recently took over a site that previously used Avada Theme but now had no more use for it – it had 10s of 1,000s of rows ready for culling. Avada custom fields use the meta key ‘pyre_’

Best way to remove these rows is to to a select first to see then do a delete – but first do a back up.

remove-post-meta-keys

Select Meta Keys

SELECT * FROM `wp_postmeta` WHERE meta_key LIKE '%pyre_%';

Delete Meta Keys

DELETE FROM `wp_postmeta` WHERE meta_key LIKE '%pyre_%';

That’s it now your database should lose a bit of bloat.

Once you know how the meta keys are named it is easy, there is also a plugin that you can select the custom fields from a dropdown and remove them, it’s called Delete Custom Fields  and works in the latest version of WordPress.

Another WordPress that you can optimise is the wp_options table, this post looks at removing data from the table in particular autoload options which appear on every WordPress post/page load.

Related Posts:

  • Generate SSH Private and Public Keys in macOS Big Sur
    Generate SSH Private and Public Keys in macOS Big Sur
  • How to make both City and Postcode fields required in WooCommerce Shipping Calculator
    How to make both City and Postcode fields required in…
  • Change WordPress Database Table Prefix Back To wp_
    Change WordPress Database Table Prefix Back To wp_
  • Keep WordPress database leaner by removing autoloaded options from wp_options table
    Keep WordPress database leaner by removing autoloaded…
  • Remove WooCommerce CSS Styles and Scripts From Pages That Don't Need It
    Remove WooCommerce CSS Styles and Scripts From Pages That…
  • Remove WordPress site health dashboard and menu item
    Remove WordPress site health dashboard and menu item
  • Removing the Product Meta 'Categories' on a Product Page - WooCommerce
    Removing the Product Meta 'Categories' on a Product Page -…
  • Stop WooCommerce checkout fields auto-filling - leave blank
    Stop WooCommerce checkout fields auto-filling - leave blank
Categorized WordPress Tagged custom fields, database, meta_key, mysql, wp_postmeta
Get Beaver Builder Now!

Tags

ACF apache archive beaver beaver builder beaver theme beaver themer bootstrap cache category checkout cpt css customizer filter flexbox footer form genesis header homebrew htaccess iconfonts image javascript jquery loop markup menu meta mysql php pre_get_posts repeater search filter pro serverpilot shortcode slider taxonomy template UI/UX while widget woocommerce wp-cli

Donate

If you found something that helped you out and would like to make a donation, that's great

PowerPack Beaver Builder Addon

Our Location

We are based in the Northern Beaches of Sydney and work with both local and overseas based clients.

Work With Us

Let us know your web requirements, see our services and use the contact form to get in touch and start the ball rolling.

Check Us Out

  • Home
  • Blog
  • About
  • Services

© 2017 · NEIL GOWRAN · POWERED BY WORDPRESS, BEAVER, AND HOSTED ON RUNCLOUD AND RACKNERD

Scroll To Top