Our Blog: Wordpress Post/Page Attributes Meta Box Missing

Aug3rd

Comments Off

Wordpress Post/Page Attributes Meta Box Missing

Tags for post entry: Wordpress Post/Page Attributes Meta Box MissingWritten by Jon Webb on September 3rd, 2009, Posted in Advice, Wordpress |

Tags for post entry: Wordpress Post/Page Attributes Meta Box Missing

As an avid wordpress developer – I was mildly annoyed when my ability to set the parent, order and template of a new/existing page disappeared. (see screenshot)

Wordpres Editor Showing Missing Metabox

Wordpres Editor Showing Missing Metabox

This particular part of the Wordpress admin area is called a meta box.

Now, I guessed that a plugin had some how hooked into the Wordpress internals and prevented this meta box from being displayed. So I disabled and removed all of the plugins from the wp-content/plugins directory. Still no joy!

Next I wondered if the box had actually been created but was being hidden in the HTML. To get around thisĀ  I cracked out Firebug, and sniffed to the offending element. As you can see – the content for the meta box was there, but was being hidden. As there were no active plugins running in wordpress I thought I was in for the long haul in bug finding duties.

Firebug - Desperately Seeking Solution

Firebug - Desperately Seeking Solution

Finally…. I thought, “maybe it’s set in the database somewhere”, so I took a full database export using the following command:
(bear with me I’m a bit of a command line freak – you could do all this with a graphical tool, and a quick text search)

mysqldump client_db > export.sql

and then

grep "hidden" -R ./export.sql | grep "parentdiv"

which bought me back the following clues through its matches & text.

INSERT INTO `gvxwp_usermeta` VALUES (1,1,'nickname','admin'),(2,1,'rich_editing','true'),(3,1,'comment_shortcuts','false'),(4,1,'admin_color','fresh'),(5,1,'gvxwp_capabilities','a:1:{s:13:\"administrator\";b:1;}'),(8,1,'gvxwp_usersettings','m0=o&m1=c&m2=c&m3=o&m4=c&m5=c&m6=c&m7=c&m8=o&hidetb=1&m9=c&m10=o&m11=o&m12=o&m13=o&m14=o&editor=tinymce'),(7,1,'gvxwp_user_level','10'),(9,1,'gvxwp_usersettingstime','1251978204'),(10,1,'gvxwp_autosave_draft_ids','a:34:{i:-1251323402;i:3;i:-1251323450;i:5;i:-1251367945;i:9;i:-1251369126;i:11;i:-1251369212;i:13;i:-1251369233;i:15;i:-1251369361;i:18;i:-1251369390;i:20;i:-1251369425;i:23;i:-1251372639;i:31;i:-1251473041;i:44;i:-1251473060;i:46;i:-1251473077;i:48;i:-1251473834;i:51;i:-1251574534;i:53;i:-1251574841;i:55;i:-1251574963;i:57;i:-1251575242;i:60;i:-1251575336;i:62;i:-1251575626;i:65;i:-1251575955;i:69;i:-1251580584;i:72;i:-1251581490;i:75;i:-1251812158;i:88;i:-1251815776;i:92;i:-1251817272;i:99;i:-1251818207;i:102;i:-1251821608;i:110;i:-1251821710;i:112;i:-1251821756;i:114;i:-1251821809;i:117;i:-1251876324;i:125;i:-1251883246;i:130;i:-1251981128;i:136;}'),(11,1,'plugins_last_view','all'),(12,1,'closedpostboxes_page','a:1:{i:0;s:12:\"revisionsdiv\";}'),(13,1,'metaboxhidden_page','a:4:{i:0;s:13:\"pageparentdiv\";i:1;s:13:\"pagecustomdiv\";i:2;s:20:\"pagecommentstatusdiv\";i:3;s:11:\"pageslugdiv\";}');

As you can see from that lot there are two special keywords: “pageparentdiv” which is the html id for the meta box which has been hidden; “metaboxhidden_page”, which is the value for a meta_key in the wp_postmeta mysql table.

To resolve my problem – all I needed to do using the above information was a quick

BEFORE DOING THE FOLLOWING, ENSURE YOU’VE BACKED UP YOUR ENTIRE WORDPRESS DATABASE AND FILES, IT MAY ALSO HAVE AN ADVERSE EFFECT ON ANY PLUGINS WHICH USE THIS INFORMATION.

mysql client_db;
delete from wp_postmeta where meta_key = 'metaboxhidden_page';

et voila! a working post attributes meta box

Fixed - The meta box returns

Fixed - The meta box returns

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • StumbleUpon
  • Technorati
  • LinkedIn
  • TwitThis

Comments are closed.