Resetting menu_order to 0 for posts in PHPmyAdmin?

Installed a plugin that allows the re-ordering of posts from any post type / category / tag using a drag/drop interface.

After some time of using, my post order went haywire and new posts began to appear in a jumbled order. The plugin’s native reset button resolved this, but the old posts are still jumbled (only for two particular categories).

Read More

Plugin author suggested updating menu_order to 0 only for the post type in question and I have a few questions:

  1. I can’t seem to find the appropriate field, which table would I look in?
  2. Post types just cover posts, pages and all custom post types, right? If I’m only having this issue with a category, I still have to reset the menu_order of the entire parent post type?
  3. I see the menu_order filter in the Codex, but I thought this was only for top level menu order, not the order of actual posts?

Related posts

2 comments

  1. This piece of mySQL code should do the trick. Go into PHPmyAdmin, click the SQL tab and paste this code:

    UPDATE wp_posts SET menu_order = 0 WHERE post_type = 'my_post_type';
    

    This should set menu_order for all posts of the post type of your choice to 0.

  2. menu_order is one of the columns in the *_posts table. In my dev database it only seems to be used for the nav_menu_item post type, but I haven’t looked into it very carefully.

    I am not sure about the connection to your categories. When I add a category, it is added to the menu as a nav_menu_item. Presumably that is how things work on your site too, unless someone has done something weird.

    I don’t think that altering that value will break anything. When I tested the menus just reordered but that is it. Make backups and test it on dummy data first.

Comments are closed.