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:

  • Woocommerce Stuck Action Scheduler
    Reducing Table Size of WooCommerce Scheduler Actions…
  • Ssh Keys
    Turn off SSH passwords in Ubuntu, connect via SSH keys only
  • Lmd Maldet Runcloud
    Set up malware scanner LMD Maldet and ClamAV on a…
  • Cloudflare Fail2ban Serverpilot
    Syncing RunCloud and Cloudflare firewalls for fail2ban IPs
  • Cloudpanel Malware Maldetect
    Set up malware scanner LMD Maldet and ClamAV on a…
  • CloudPanel Fail2ban
    Install and configure Fail2ban for CloudPanel on…
  • Disable Wordpress Default Update Emails
    Disable default WordPress emails on WordPress,…
  • Browsersync Gulp Valet
    Getting Browsersync running with Gulp 4 and Valet on macOS
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 category cpt css customizer fail2ban filter flexbox footer form genesis header homebrew htaccess iconfonts image javascript jquery loop markup menu meta mysql php repeater runcloud search filter pro serverpilot shortcode slider taxonomy template ubuntu UI/UX while widget woocommerce wp-cli
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, OPEN LITESPEED, CLOUDFLARE AND HOSTED ON RUNCLOUD AND RACKNERD

Scroll To Top