Functions
How to check if a user has a specific role or capability in WordPress
In many WordPress projects, you will need to check if a user has a specific role or capability. In this tutorial, I will provide custom functions to accomplish that. custom function to check if the user has a specific role : Once you have defined the above code in functions.php, you can check for a
Remove meta generator tags by WordPress and other plugins
Meta generator tag in WordPress reveals the plugin or WordPress core version which makes WordPress vulnerable. So, here i list snippets to disable meta tag generator by various plugins. Remove WordPress & Woocommerce meta tag generator This code will disable meta tag generated by WordPress, Woocommerce and many other standard plugins that hook up with
Remove website field from comment form to reduce spam
Spammers love WordPress comment forms. They use bots that automatically post spam comments with malicious links in hundreds of websites. Their goal is to gain SEO juice out of your site. But what if there is a way to discourage them from using such tools on your website? Its simple, we can disable the website
How to create a short code to display recent posts
You may want to display most recent posts of your website in your WordPress website post or page. You can achieve that creating a custom WordPress shortcode. Let me first explain what is a WordPress shortcode and how it works. What is a WordPress shortcode? WordPress Shortcode is a feature defined in WordPress core that