Viewing a WordPress page, post or custom entry
Having moved the sections around how do I reset.
The idea is how to restore the edit view of
Whilst developing a recent plugin I had moved the meta box sections around. But, of course, I wanted to see the default. As per a fresh installation.
So how do I reset the layout of the displayed WordPress displayed content area sections?
For this approach you’ll need access to phpMyAdmin via your hosting control panel.
The relevant saved options in the database table wp_usermeta are to be deleted.
Login to phpMyAdmin to begin.
In the left hand database & table menu click on the database for the WordPress website of interest.
From the top row of tab options click on SQL.
The content entry box can be used to enter the SQL which will be used to show the specific entries in the wp_usermeta table.
wanted to reset the metabox positions after moving them round
In you PhpMyAdmin query for: (if you have a different database prefix, change that in the query, also change the user_id to yours)
SELECT * FROM wp_usermeta WHERE user_id =1 AND meta_key LIKE 'meta-box%'
Click on Go in the bottom right corner.
Look at the meta_key column to determine which plugin, theme, post or whatever the entry is associated with.
Delete those values which are associated with the item which you are looking to reset, and you will get the original order back.
Easy – I simply deleted the relevant one.
And the user id> Well its a development website on a development computer with the initial user as my admin login. So no problems there with knowing the value.
But this is cumbersome. You need to know the relevant user id. It would be better to use the user name.
This is easier to find and has less chance of making changes to the wrong account.
For this we’ll modify the SQL using a join to combine the two tables of usermeta and users.
SELECT * FROM wp_usermeta JOIN wp_users ON wp_usermeta.user_id = wp_users.id WHERE wp_users.user_nicename ='neil'
As previously change the relevant parts.
In this example we’ll show all items in the usermeta table, as before. The third row shows the join with the users table. With the linkage by the associated user id.
The last line is the restrictive clause, this time using the displayed name of the user.
With a little SQL and the use of phpMyAdmin we are able to delete entries in a WordPress table, resetting the order of the metaboxes from a plugin, page or post.