Post types: Visibility and URLs tabs
4 min read
Both tabs appear when Advanced settings is on in the post type editor (Custom post types).
Visibility tab
Setting | Default | Effect |
|---|---|---|
Show in admin | On | Gives the type an editing interface in the admin. Turn off for types that are managed only by code. |
Admin menu | Top-level menu | Where the type's menu entry goes (see below). |
Show in navigation menus (Appearance → Menus) | On | Lets editors add the type's entries and archive to menus. |
Show in the admin bar (+ New) | On | Adds the type to the "+ New" menu in the black admin bar. |
Exclude from site search | Off | When on, entries never appear in the site's search results. |
Menu position | empty | A number; lower numbers appear higher in the menu (Posts is 5, Pages 20, Comments 25). Empty lets WordPress place it below Comments. Minimum 0. |
Menu icon (Dashicon class or image URL) |
| A Dashicons class such as |
Meta box callback (PHP function name) | empty | See below. |
Admin menu
Three radio buttons:
- Top-level menu: its own entry in the main menu.
- Under an existing menu: a sub-item of another menu. Type the parent in the box, for example
edit.php?post_type=page(under Pages) ortools.php(under Tools). If you leave the box empty,tools.phpis used. - Hide from the admin menu: no entry. The type still works, and you can link to its list screen yourself.
The "Under an existing menu" value is the file name WordPress uses for the parent. For another custom post type that is edit.php?post_type=key.
Public, publicly queryable and the admin
The Public toggle in Basics is saved as WordPress's public flag, which other plugins read (sitemaps, SEO plugins, REST listings). Mass Custom Fields sends every visibility setting below explicitly, so Public does not switch them on or off for you: set Show in admin, Publicly queryable, Show in navigation menus and Exclude from site search yourself. A common combination for data that only has an admin screen: Public off, Publicly queryable off, Show in admin on.
Meta box callback
An advanced option for developers. For safety, the callback must be on an allow-list; none are allowed by default, so a name typed here is refused with: The callback "name" is not allowed. Allow it with the wpmcf/post_types/allowed_callbacks filter.
add_filter( 'wpmcf/post_types/allowed_callbacks', function ( array $allowed, string $arg ) {
if ( 'register_meta_box_cb' === $arg ) {
$allowed[] = 'my_book_meta_boxes';
}
return $allowed;
}, 10, 2 );The function must exist when the type is registered.
URLs tab
Setting | Default | Effect |
|---|---|---|
Permalinks | Default (post type key) | Default (post type key): entries live at |
Custom slug (only for Custom slug) | empty | Letters, numbers and hyphens. Empty falls back to the key. |
Use the front URL prefix (with_front) | On | If your permalink structure has a fixed prefix such as |
Feed URLs | On | Creates feed URLs like |
Pagination in URLs | On | Creates |
Publicly queryable | On | Allows front-end queries for the type, so single entries can be opened by URL. |
Archive page | Off | Gives the type a list page of all entries. |
Custom archive slug (optional) | empty | Only when Archive page is on. Empty: the archive uses the same slug as single entries. |
Disable query variable | Off | Removes |
Custom query variable (optional) | empty | Replaces the key as the query variable name. Hidden while the variable is disabled. |
Examples
For a type with key book:
Settings | Single entry | Archive |
|---|---|---|
Defaults, Archive page on |
|
|
Permalinks: Custom slug |
|
|
Custom slug |
|
|
Archive page off |
| no archive |
The Archive column of the post type list shows "On" for any type with an archive.
Applying URL changes
Any change here schedules a rewrite flush that runs on the next page load. You do not need to resave Permalinks (see Custom post types). If entries still return "404 Not Found", the cause is almost always one of: Plain permalinks selected in Settings › Permalinks, a slug clash with a page or another plugin, or an archive slug that equals a page slug.
Notes and limits
- Changing a slug does not redirect the old URLs. Add redirects yourself if the old URLs are public.
- Slugs are lowercased and cleaned like WordPress slugs; spaces become hyphens.
Still stuck? Contact support