Category Code snippets

Allow PHP in WordPress default text widget

The default text widget in WordPress only supports HTML. You can extend the functionality of the text widget by making it possible to execute PHP. Put this code in the functions.php of the theme you are using: add_filter(‘widget_text’, ‘php_text’, 99); function…

Turn off WordPress emojis

Support of emojis are standard ever since version 4.2 of WordPress. Which is nice. But when you don’t need this, it only puts extra time to the page load and still does nothing. WordPress doesn’t have an option to turn…

Avoid or limit revisions

When you edit a page or post the old version will automatically be saved. Every time you edit a page or post, the old version is saved. These old versions pollute the database unnecessary, especially when you never delete them.…

Add the expires header

To speed up your WordPress website, it is very useful to add the expires header to the .htaccess file. With the expires header you tell the browsers that the files that are loaded by your website, will not change for…