Want to remove the private/protected from your post title in your WordPress blog/websites? If your answer is YES, then keep your close attention in this as I am going to share how to remove the private/protected from your post title in WordPress.
Copy the below code and add at the end of your themes/your-theme-folder/functions.php file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
function the_title_trim($title) { $title = attribute_escape($title); $findthese = array( '#Protected:#', '#Private:#' ); $replacewith = array( '', '' ); $title = preg_replace($findthese, $replacewith, $title); return $title; } add_filter('the_title', 'the_title_trim'); |
I hope this tutorial helps you, if you have any questions regarding WordPress, then feel free to put your comments in below comment section. Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wordpress tutorials, wordpress tutorials for beginners