WP Munk > Blog > Code Snippets

Code Snippets

How to Bulk Remove Featured Images in WordPress

In WordPress, you can only remove post featured image one by one by editing each post and clicking on the “Remove Featured Image” link, which  is easier to do if you have only few posts but if you have hundreds of posts then removing them one by one can be a daunting task.  But fear not, there is a simpler and easier way to bulk remove  featured image in WordPress. […]

How to add DNS Prefetch in a WordPress Theme without using Plugin

Go to Google, search for any keyword, hold two seconds and then click the first link, that site will open instantly on your browser without showing you any loading progress.  That is called DNS Preftech. Google defines it as: DNS prefetching is an attempt to resolve domain names before a user tries to follow a link. This is done using the computer’s normal DNS resolution mechanism; no connection to Google […]

How to Remove WordPress Dashboard Widgets

Working on a recent project, a client asked me to clean up all the widgets that shown on default WordPress Dashboard as soon as you login. They were not using any of those widgets so wanted to see a clean dashboard upon logging in. Removing default Dashboard Widgets is easy by adding few lines of codes into your theme’s functions.php file. Copy the following code and paste it in your […]

How to display all custom fields (name AND value) in a post?

You are working on a custom WordPress theme that uses lots and lots of custom fields and you suddenly want to see what all custom fields are assigned to any post.  You can do by going into the dashboard of the site and editing the specific post but what if you want to show it on the front-end of site on the single post template? What if you have tons […]