6 WordPress functions I include in every project

When developing WordPress themes I always add some prebuilt functions that either extend the functionality or remove overhead and unnecessary code. Here’s few of them.

Remove emojis

This is just useless stuff which generates extra code and slows down loading of your site. Use the following function to remove them.

Remove scripts versions

I know that by saying this a lot of developers might scowl but I’ve never really found use for script versions being suffixed to script links. Why not just remove ’em?

Remove WordPress version

If you are paranoid about attackers exploiting your WordPress installation you might want to hide the output of the WordPress version your site is running. Although I suggest implementing extra security features as well.

Remove update notification

This one is pretty optional. I just don’t plain need or like the constant nag to update, especially when there are times when WordPress updates regularly every few weeks. Remove the update notifications from your Dashboard using the following script.

Estimated reading time

Most of my projects require that I write functionalities that will determine how long it will take user to read the content of the page. A really simple and crude implementation of that functionality is the function below.

Add custom classes to elements

And my personal favorite and must-have – adding custom HTML classes to HTML/BODY tags based on conditions you specify. You might want to add a class to BODY tag on only one template file and you can do it using the function below.

Feel free to contribute to this list in any way. If you have any suggestions on how to make these functions better or have a personal favorite you would like to share I would be happy if you’d do so :)