Category: General

  • Building A Simple WordPress Options Page

    Options table (prefix_options) is WordPress’s way of providing a key-value store for plugin authors. It’s a good place to save any key value data such as settings used by your plugin. Every usable plugin will need to store some piece of data that is only related to the plugins. In most cases, the options table…

  • Redirect All Or Specific Pages to Homepage

    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…

  • Remove Shipping From Woocommerce Emails

    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…

  • Show A Popup On WooCommerce Cart Page When Products From Specific Categories Are Added

    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…

  • Show Category IDs

    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…

  • WordPress: The Right Way To Check If A Plugin Is Active

    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.…

  • WordPress Data Validation Sanitization And Escaping

    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…

  • WooCommerce Customization: Hide Price Data from Order Email

    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…