How to discover custom field names via PHPMyAdmin

21 March 2010 · 0 comments

Use PHPMyAdmin to view the database that runs your WordPress blog. You can do handy things, such as finding out the names for custom fields.

You may have noticed that the front page of KnowIT (here) uses a thumbnail image for each post. That thumbnail is provided by the Thesis theme I use.

Thesis Thumbnail image custom field.

Thesis Thumbnail image custom field.

At first I would add a Post Image to each Post and allow WordPress to create a thumbnail from it. That’s very handy, as it’s automatic.

But before long I realised the automatic thumbnails were each between 30 and 50 KB. At 10 images per front page view that was 300 to 500Kb, and made the page slow loading.

It’s a lot more work, but now I create the thumbnail image myself and add it as a Post Image Thumbnail. Each thumbnail is now around 7Kb. That’s reduced each page load by a good 400Kb, speeding up the blog and reducing bandwidth.

For reasons I don’t want to spell out here, I wanted to find out the exact names for those custom fields.

How to find custom field names

Here’s how to discover those names:

Some meta_key names for my blog..

Some meta_key names for my blog.

  1. Make sure at least one Post on your blog uses the custom filed you wsh to find information for.
  2. Visit the hosting Control Panel for your blog.
  3. Open PHPMyAdmin and select the correct database.
  4. Click on the postmeta table. It probably has a prefix, such as wp_. That lists all the rows in the table, probably 30 or so per page.
  5. Scan the column called meta_key until you see the name you need.

For example, in Thesis you can assign a specific post image, post image alt text, post image thumbnail and alt text to each Post. I wanted to find the specific meta_key names.

After viewing the postmeta table I soon found them:

  • thesis_post_image
  • thesis_post_image_alt
  • thesis_thumb
  • thesis_thumb_alt

Now, with the exact names available I can go ahead and construct a search or use them any other way I like.

Be the first to comment ⇒

Tell us what you think.
Note: there may be a delay before your comment appears. I now approve all comments from new visitors, in an attempt to keep spam at bay.

Add your Comment

Older Post:

Newer Post: