Increase WordPress Security using the wp config php file - Increase WordPress Security using wp-config.php

Increase WordPress Security using wp-config.php

Here are some examples of security configurations that can be added to your WordPress website’s wp-config.php file: Disable file editing define( ‘DISALLOW_FILE_EDIT’, true ); This configuration will disable the built-in WordPress file editor, which can prevent users from accidentally or intentionally making changes to the core WordPress files. Change the default database table prefix $table_prefix … Read full article →

Display the total number of WooCommerce products - Display the total number of WooCommerce products

Display the total number of WooCommerce products

To display the total number of WooCommerce products, you can use the following code snippet: <?php $products = wc_get_products(array( ‘limit’ => -1 )); echo count($products); ?> This code uses the wc_get_products() function to retrieve all published products, with no limit on the number of products returned. The count() function is then used to count the … Read full article →

WordPress hooks tutorial - WordPress hooks tutorial

WordPress hooks tutorial

WordPress hooks are a powerful feature that allows you to customize and extend the functionality of your WordPress website without modifying the core code. They are essentialy points in the WordPress code where you can add your own custom code or functions. There are two types of hooks in WordPress: actions and filters. Action hooks … Read full article →

Building a simple WordPress shortcode to output Website information - Building a simple WordPress shortcode to output Website information

Building a simple WordPress shortcode to output Website information

Here is a simple WordPress plugin that uses the [site] shortcode to display the website name: It uses the get_bloginfo() function to retrieve website information, and do_shortcode() function to display the information in the WordPress post or page. We can use get_bloginfo() function to also display additional information such as URL, WordPress version, etc. Here … Read full article →

Suggestions to reduce the wp options table size - Suggestions to reduce the wp_options table size

Suggestions to reduce the wp_options table size

In this post I discussed an example where wp_options table had 900k rows of plugin-based data in it, causing the wp-admin dashboard to load slowly. As noted there, good coding practice is for each plugin to create its own database tables and use those instead of default WP tables. While the WordPress community actively improves … Read full article →

Optimize WordPress Database Tables - Optimize WordPress Database Tables

Optimize WordPress Database Tables

There are several ways you can optimize the MySQL database used by your WordPress site: Optimize tables Optimize all tables in your database: OPTIMIZE TABLE wp_posts, wp_comments, wp_options, wp_usermeta, wp_term_relationships, wp_term_taxonomy, wp_termmeta; Replace wp_ with the database prefix that you are using for your WordPress installation. Repair tables Repair any damaged tables in your database: … Read full article →

WordPress version usage statistics - WordPress version Usage Statistics UPDATED

WordPress version Usage Statistics UPDATED

This table displays the market share (in %) for each WordPress version of all the active WordPress websites on the internet. $(document).ready(function() { $.getJSON(‘https://api.wordpress.org/stats/wordpress/1.0/’) .done(function(resData) { var table_str = ‘ WordPress Version Usage (in %) ‘; $.each(resData, function(key, value){ table_str += ‘ ‘ + key + ‘ ‘ + value + ‘ ‘; }); table_str += … Read full article →