WordPress: Removing Custom Fields

WordPress: Removing Custom Fields

I installed plugins a while back and subsequently deleted the plugins. Each time that I write a post and see the Custom Fields, it reminds me that I need to remove these extra custom fields. So today I opened up PHPMyAdmin and started to look for them in the SQL and couldn’t find them. I tried to search the full database and it didn’t work. Thankfully with a few searches I found references that helped.

Custom Fields in Post

Where are the Custom Fields?

On WebNots.com, it explained where the custom fields are stored. I thought they would have their own table, but they are added into the Post Metadata table (wp_postmeta table) in the meta_key field. (One of my friends referred me to a Ralph Kimball book regarding Data Warehousing and I believe that is why these fields are in a table with their values and not separate fields.) Source: https://www.webnots.com/how-to-delete-unused-custom-fields-in-wordpress/

What is the Correct Search Argument?

t first I tried the term “ast” in the Value with the LIKE operator and was not successful. I was looking for fields that started with “ast-” or “ast_” which wee installed with the Astra Theme. I learned from the SQL LIKE Operator article on the W3Schools.com site that the % acts as the wildcard character in the value when using the LIKE operator.

I totally didn’t take screenshots of all of the “ast” searches so I started again. 🙂 Boldgrid had installed custom fields when I moved my site to Dreamhost and used their installer. I removed their theme and a lot of other plugins but the remnants remained.

Boldgrid in Custom Fields Menu
Search for Bold%
Boldgrid search results

Once I found them I CHECKED ALL and then clicked DELETE.

When did I start using WordPress?

Recently I saw a question: When did you start using WordPress? I couldn’t really remember. But I have seen the Blogger custom fields in my posts. Since I was in the database, I thought I might find the answer. This time I searched for “blogger%”.

WordPress: Removing Custom Fields

First Blogger Post

It turns out my first Blogger post was in November 2006.

First Blogger Post 2006-11

Last Blogger Post

My last Blogger post appears to be in January 2013.

Last Blogger Post 2013-01

WordPress Start

My guesstimate is that my first WordPress experience was in 2013.


10 responses to “WordPress: Removing Custom Fields”

  1. @tmichellemoore Following because I could also use some recommendations on a database cleaner.

  2. @scottbrim I totally don’t have any recommendations on a database cleaner. 😊 But I did examine the tables to see if any tables “seemed” extra. Once I figured out how to find those custom fields, I started looking for other plugins I removed. It’s tedious. I found a plugin that lists ALL custom post types, not just CPTs the plugin created, so I am sure there has to be one that can show all custom fields.

  3. @tmichellemoore This is also a simple query to show the metakeys with the most records, so you can clean up more if you don’t use them anymore:SELECT meta_key, COUNT(meta_id) AS records FROM wp_postmeta GROUP BY meta_key ORDER BY records DESC

  4. @JosKleverWebSupport Thank you! I will try this! This is more intuitive!