WordPress has many complex plugins to handle redirection, such as Redirection by John Godley. However, in this tutorial, we will build a simple plugin that will redirect all or specific pages to the homepage. You may use this plugin where a sophisticated plugin is unnecessary. Plugin Header Lets first write the plugin header, the comment…
If you have free shipping for all your products in your store and you have already shown that to your customers, you may want to remove the Free Shipping row from the email sent to customers after purchase. In this article, I will show you three ways to remove the free shipping row from email…
In this tutorial, I will show you how to show a nice popup when user cart contains products from specific categories. Let’s start by defining two constants that will hold some values for us that can easily be changed whenever needed. Define Necessary Constants Function to show JavaScript Alert I know I said popups. But…
By default when you view the list of post categories or WooCommerce product categories, WordPress doesn’t show the IDs. But sometimes, you may need those IDs, say when you want to put them in a shortcode. In this tutorial, we will build a small plugin that will show the category IDs on post and product…
There are many different ways to check if a plugin is active on your WordPress website. However, there are pros and cons to each approach. In this article, we will explore different ways to check if a plugin is active on a WordPress site and finally write a code snippet that will address all issues.…
Coding defensively is very important because your users are free to enter whatever data they want, and some of them will do so with malicious intent. As a programmer, you must ensure that you are validating, and sanitizing user input when saving into the database and also properly escaping when displaying the data back to…
In this tutorial, I will show you how to hide price data from WooCommerce emails. Let’s just take a quick look at how the email will look like before and after the removal of price data. Before the removal of price data After the Removal of Price Data Method 1: Remove Price Data With CSS…