Quantcast
Channel: Techie Buzz » WordPress Tips
Viewing all articles
Browse latest Browse all 12

Post Meta Values Automatically Deleted in WordPress?

$
0
0

I use a lot of custom meta fields in WordPress posts for several reasons. They allow me to manipulate multiple posts without having to write code for a specific conditions.

WordPress Logo

However, of late, I came across a very annoying problem where custom meta fields were automatically deleted for some reason that was unknown to me. It was annoying me to no end because I had to manually go in and add those custom fields for the posts over and over again.

I didn’t have much time to figure out what is wrong and left in some debug code which would allow me to later on see how things were disappearing. Today, I checked those logs and found out the problem with the disappearing custom meta fields.

The problem was that, WordPress processes hooks for the edit_post, publish_post and save_post not just for editing the posts but also various other functions like while approving comments too, but the code in question always tried to find the $_POST variables and delete them if they didn’t exist. This was the mystery behind those disappearing post custom meta fields.

Solution For The Problem?

If you are not a developer, you are better off disabling those plugins and adding those fields manually using WordPress write interface. However, if you use a plugin you might lose additional functionality it provides. You could always send an email to the plugin developer asking them to make the appropriate changes.

If you are a developer, Mark Jaquith has a post which talks about avoiding such problems. You can read the post here and modify your plugin or theme to fix this issue.


Post Meta Values Automatically Deleted in WordPress? originally appeared on Techie Buzz written by Keith Dsouza on Friday 18th March 2011 07:58:00 PM under Webmaster Tips. Please read the Terms of Use for fair usage guidance.

The post Post Meta Values Automatically Deleted in WordPress? appeared first on Techie Buzz.


Viewing all articles
Browse latest Browse all 12

Trending Articles