Marko Dimitrijević

cowboy with a lasso trying to catch a WordPress word

capital_P_dangit

Although I dived into WordPress back in 2012, I remember capital_P_dangit function and al the WPDrama around it. Did you know about this function?

This is not about marking anyone feel as less experienced developer, after all providing solution to a problem is what really matters.

When having a brand or a trademark you will do your best to protect it, even some popular plugins have clear guidance on how to correctly type a plugin name when you are mentioning it. Not to mention great impact on SEO which leads to lower search visibility, confusion in branding and missed traffic opportunities. So there was a problem.

In 2010, before the release of WordPress 3.0 Matt himself nailed this problem in a Texas Cowboy style without Trac tiket, wp prefix and with an idiom “dang it”. And event today this funcion is being executed in every single page of your website in order to correct every single “WordPress” without a capital P, to “WordPress”, and wolla it is solution.

I am not making judgments. We all sometimes make turbulence decisions in programming, and many of us would do the same to protect our “child”, but to slightly improve the speed of your WordPress it is maybe better to remove it and luckaly there is a filter:

/* Removing capital P dangit */
 remove_filter( 'the_title', 'capital_P_dangit', 11 );
 remove_filter( 'the_content', 'capital_P_dangit', 11 );
 remove_filter( 'comment_text', 'capital_P_dangit', 31 );

If you want to feel that buzz from 15 years ago I think there are still plenty of posts to read, just google it, and just to clarify I am truly grateful for WordPress so huge THANK YOU, without it I probably won’t work as a developer and this post wouldn’t exist 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *