We can use the protected_title_format
and private_title_format
filters, available since WordPress version 2.8:
add_filter( 'protected_title_format', 'wpse_pure_title', 10, 2 );
add_filter( 'private_title_format', 'wpse_pure_title', 10, 2 );
function wpse_pure_title( $format, \WP_Post $post )
{
return 'mycpt' === get_post_type( $post ) ? '%s' : $format;
}
to get rid of the “Private:” and “Protected:” parts on the front-end for the mycpt
post type.
We don’t need a is_admin()
check here, because these filters only run in the front-end.
Related Posts:
- Using php to overwrite or replace title tag, while using yoast [closed]
- Two title tags in my header
- Problem in wordpress with “-“
- order by second word in title?
- the_title filter applying to menu items
- Modify page title format (when using title-tag)
- Fill post titles from post content?
- REQUIRED: The theme must not used the tags. | REQUIRED: The theme must not call to wp_title()
- How to set custom title of custom page template?
- Display post title on individual image attachment page
- Include category title in wp_title
- Get wp_title() from page ID into a variable
- Custom Post Type Title Placeholder [duplicate]
- Site title not showing. What can I do?
- SEO meta description and title tag Yoast SEO
- What code do you use to generate the text to go into the HTML title tag?
- Multiple Conditions for Child Page Title
- How come my first blog post and my home page have the same title?
- Where do I change the ACTUAL title tag that is set in the header.php
- Why doesn’t YoastSEO allow me to set the title/description for the home page? [closed]
- Hide price & title in store thumbnail dispay? [closed]
- How to modify a title tag in genesis?
- Add anchor text to php
- How to echo a different title to the page if it’s opened on an android mobile phone
- Adding schema.org itemprop to WP4.1 Title Tag
- Remove post title
- Set max title length – similar to excerpt length for outside of single.php
- Automatically add words if duplicate post titles
- Remove Title of youtube video
- How to insert icon in site title
- How can I automatically insert the page content as the title?
- HeadSpace2 double title on homepage
- Changing title & add Breadcrumbs
- Page title is showing category name as well in the google search results
- How to Change The Title in WordPress For SEO
- change title separator
- Sanitize the output of the_title() or the_title_attribute() to remove whitespace
- Modify conditional titles to include parent and page number
- Blog Title not showing up on main Blog page
- Why is a category/ tag name prefixed to title of every page?
- For better digital journalism, how to store a second title and excerpt?
- Cannot use ‘CSS’ in post title
- Replace text in the Title
- How to echo all the_title() without text after last “-“
- set title attribute in wp_get_attachment_image()
- How to solve the site tag being displayed twice?
- Print post title with markup
- Permalink and ACF field
- Remove tagline from the HTML on the home page without plugin?
- Homepage meta title and description not showing in search engines?
- How to remove Title and CSS styling of title from particular page
- Double bar “|” in title (By WP SEO Yoast?) [closed]
- Delete a repeated part of post title in WordPress
- How to put post title or keyphrase in content on different places automatically?
- Change meta data of pdf file
- How can I add a title to this ‘maintenance mode’ function?
- How to give titles to custom post type as “unique” incremental number?
- Modify link options when hovering over post title
- Change auto post title generation according to different post properties
- How to get Title of Home Page to Appear on Page
- Need help with page title (Static front page)
- Show post title words one by one [closed]
- Array to modify post titles
- Text under post title on frontpage but don’t want it in full post
- How do I remove ‘Home’ from homepage title?
- How to set “lang” attribute for post/page title?
- Inconsistent title for posts
- Title don’t function as link
- Enclose title within a div?
- How to add a span class in the post title?
- Adding a class to post title considering the title length
- SEO module to change tag title for different listing page
- Hide a page title in WordPress 3.0
- Change post title but not in widgets/menu/etc
- how to change the title of tag page?
- how to add dynamic text before and after of post title
- Title tag on home using front-page template not showing
- Page Title Dependant On Input?
- Reorder title tag and description tag with wpseo_title and wpseo_metadesc
- Blog Post Title apearing twice
- How do I separate the post title from the content in an excerpt coded thus:
- What change does this code need to include title of parent?
- Setting Page Title Yoast
- How to modify title tag in a plugin?
- How to Implement Category.php page title in wordpress custom template?
- Comparing pre-saved post_title to post-saved post_title
- Different titles for static, posts, and every xy page
- The entity “raquo” was referenced, but not declared
- How to get the meta title of a page configured as blog (loop)
- Generate page title tag from the content of H1
- My post titles is getting mashed up with my blog title
- What is the wordpress page title php code?
- How to add … after a particular word/character limit to the title
- Remove post title in catogory page
- Change Bookmark Name without Changing TITLE Tag [closed]
- How can I change tagline in title tag “Just another wordpress site”?
- I have a problem with Home Page title
- Trying to get more space removed from my header
- how to put breadcrumb under Title [closed]
- How to fix special characters when the title or excerpt is shortened [closed]