Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Removes the word "private" and "protected" from the posts title.
* Remove Private and Protected Title Prefix
* @package RemovePrivateAndProtectedTitlePrefix
* @author Bernhard Kau
* @license GPLv3
* @wordpress-plugin
* Plugin Name: Remove Private Title Prefix
* Plugin URI:
* Description: Removes the word "private" and "protected" from the posts title.
* Version: 0.1
* Author: Bernhard Kau
* Author URI:
* License: GPLv3
* License URI:
* Remove the "Private" and "Protected" prefix from headlines
* @param string $content Text displayed before the post title. Default 'Private: %s'.
* @return string
function remove_private_and_protected_prefix_title_format( $content ) {
return '%s';
add_filter( 'private_title_format', 'remove_private_and_protected_prefix_title_format' );
add_filter( 'protected_title_format', 'remove_private_and_protected_prefix_title_format' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment