If you filter pre_get_shortlink
and return anything but false
WordPress will not create a shortlink with its own logic. If your return value is empty, the shortlink UI will not be printed.
Combining both leads us to:
add_filter( 'pre_get_shortlink', '__return_empty_string' );
If you want to restrict the filter to a specific post type, check the second parameter:
add_filter( 'pre_get_shortlink', function( $false, $post_id ) {
return 'page' === get_post_type( $post_id ) ? '' : $false;
}, 10, 2 );
Related Posts:
- Filter Posts from the Main Query
- Change CPT Edit Target Link for Admin List
- How to enqueue scripts on custom post add/edit pages?
- Row actions for custom post types?
- remove custom post type permalink
- How can I remove the “Add New” button in my custom post type?
- How to change “Draft” string for status of custom post type to “Unavailable”?
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- How do I filter the excerpt metabox description in admin?
- Unregister post type from child theme
- Filter for “get_post_type_archive_link()”
- How to correctly get post type in a the_title filter
- Best way to filter featured image text for a custom post type?
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- WP Admin default view mode for Custom Post Type
- Remove date and category filters when editing custom post types
- With what hook can I address all posts from all custom post types when they are published?
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- What hook should be used to programmatically create a post only when master post is updated?
- How to register custom post types in a plugin?
- How to get Custom Post ID by adding filter to child theme’s function
- Can’t unregister parent theme’s CPT from my child theme
- Modifying date filter on admin page for custom post type to link to custom field
- Add html to cpt main page / admin edit.php
- register_taxonomy and register_post_type does not work [closed]
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- Displaying custom taxonomy in the admin list of a custom post type
- Filter term taxonomy metabox in custom post type
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- Filter hierarchical custom post type admin page by parent, and include children & grandchildren
- How can I add a filter to a particular post format?
- Is there any way to get list of all possible filter hooks for all post types?
- Create new custom post and post category of same name
- Add a custom text to admin footer in a Custom Post Type page
- Use remove_meta_box conditionally on custom post type
- wp_trash_post action hook with custom post type
- How do I amend form data before it is saved for a custom post type
- sortable columns for multiple custom post types not working
- Catch and display error on save_post action
- How to recover the post ID earlier in the WP admin hook action “firing” sequence?
- Using `set_transient()` when saving a custom post type
- Using publish_{custom-post-type} hook for custom post type to update meta doesn’t work
- Best way to fix bad count on All | Mine | Published
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- Store a value in global scope after init hook is fired
- Dynamic page for nav items used as filters
- Post Click Redirect to Custom URL instead of Single Post Page
- How to store additional data that is related to core data
- Keep br tags from stripping
- Add filter button to custom post type in admin area
- Adding Information To All Posts Screen
- do action inside a class is not working
- Filter Content on all Post Types
- Filter wp_dropdown_categories Per Post Type
- Hook only specific post type
- Create action running on trashed_post hook to modify post_meta value
- Custom post type template not loading from plugin
- Add a post when another post type is inserting
- comments hooks on custom post type
- How to hook into action/filter call
- Custom Taxonomy Filter Issues
- Change Post Meta via AJAX from the posts list table
- Action hook to control access to certain parts of my site
- Custom Attachment Type
- Sorting custom post types in edit.php : Post disappear
- How to customize `Edit-Post` Screen
- What filter or action hook to use in order to load some code before the template begins printing in BuddyPress? [closed]
- Sort by post word count in admin area
- show most viewed posts of last days by link?
- Filter search posts by post meta?
- Modifying search results based on post_type
- How to display magic field’s custom write panel in wordpress theme?
- Remove filter and view options from custom post type edit screen
- jQuery UI & Admin (Calendar)
- Change ordering of fields of custom post type in admin page
- How to display author details in a custom post type in the wordpress backend?
- Is possible register two archive pages for single custom post type?
- Add Content Column to Custom Post Type backend
- Display custom post front end filter by ACF equals current user
- Display custom product option in admin order details
- Change Text in Admin Panel
- Limiting actions only to edit.php page for specific custom post type
- Admin slow on Postlist (over 30k Posts in Database)
- Replace Data In Post & Update Meta Field Post Is Saved
- conditional filter
- custom filtering admin columns
- Hide title field of selected post-types on edit pages
- Ajax Post Filter | Split Taxonomy Into minPrice & maxPrice
- How can I put content before my custom post type default pages?
- apply_filters() and call_user_func() to define and call a function outside a class
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Query filter by value in meta_value array
- get_posts() returns empty on custom post type /wp-admin/edit.php
- After inserting new post with wp_insert_post() the post is not visble to WP_Query, but the same WP_Query works for post inserted from wp-admin panel
- Put featured image under post title in admin area
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- list articles in admin showing nested categories or slugs?
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- style_loader_tag not changing stylesheet to preload