1

I just discovered a new meta field on the newly created custom post type page. The meta name is slug, and it's under the wp editor field. What's that, and how can I remove it?

4

You can remove the slug metabox from a post type with remove_meta_box:

add_action( 'add_meta_boxes', 'my_add_meta_boxes' );
function my_add_meta_boxes() {
    remove_meta_box( 'slugdiv', 'my_post_type', 'normal' );
}
| improve this answer | |
  • 2
    Thanks, but why does it have a new metabox? I also can edit the url under the title, whats the difference? – Rinoleti Mar 13 '13 at 20:25
  • Be warned that this seems to break the slug editing functionality under the post title. core.trac.wordpress.org/ticket/18523 – MarcGuay Jan 5 '17 at 15:25
2

on the top right of the page where you edit your post or page you will see two buttons: [Screen options] and [Help]. Click on [screen options]. You will see all kinds of options, unmark the one labeled "Slug" and it will disappear from the post/page edit page.

If you want to know what that was: http://codex.wordpress.org/Glossary#Post_Slug

Hope that helps

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.