Delete Expired WordPress Transients - Delete Expired WordPress Transients 🚮

Delete Expired WordPress Transients 🚮

WordPress uses transients to temporarily store data for its plugins and themes. By managing transients you can optimize your website for speed and make sure your website is always functioning properly. Here are a few methods how to safely delete expired WordPress transients: Delete Expired WordPress Transients using WPCLI To delete only expired transients use: … Read full article →

Delete inactive Plugins and Themes using WPCLI - Delete inactive WordPress Plugins and Themes using WPCLI

Delete inactive WordPress Plugins and Themes using WPCLI

Deleting all inactive WordPress themes and plugins from your website is a recommended security practice. Even when deactivated, old, insecure plugins and themes might still pose a threat to the security of your WordPress website. Here are oneliners to remove inactive themes and plugins from your WordPress website using WP-CLI. List all inactive WordPress themes: Delete … Read full article →

create a new wp admin users - 5 Easy ways to Create a WordPress Admin user

5 Easy ways to Create a WordPress Admin user

Here are five different methods to create a new WordPress Admin user. In all of the examples below I will use the following username/password combination, so make sure to change it before running any of the commands: username123 change username123 with your username password123 change password123 with your password [email protected] change [email protected] with your email … Read full article →

Install WP CLI in cPanel with CageFS - Install WP-CLI in cPanel with CageFS

Install WP-CLI in cPanel with CageFS

In this guide, I talked about adding WP-CLI to your system, but if you use cPanel with CloudLinux, you also need to include it in CageFS so that all users can access the wp command. First, download the WP-CLI command inside /usr/local/bin Add WP-CLI path to CageFS: and inside add: save the file, then update … Read full article →

wpcli w3tc - Purge cache from W3 Total Cache plugin using WP-CLI

Purge cache from W3 Total Cache plugin using WP-CLI

Here are some useful commands to clear cache from the terminal with wpcli: cdn_purge purge URLs from CDN and Varnish flush all flushes all cache related to W3TC (Page Cache, OC, DB Cache, Minify, etc.) flush page flushes pages cache only flush posts flushes both pages & posts cache flush database flushes DB cache flush … Read full article →

wp package install - Install a WP-CLI Package

Install a WP-CLI Package

Packages can be installed to add functionality to WP-CLI, for example wp-cli/wp-super-cache-cli package will add functions for managing WP Super Cache plugin from the terminal. Here is a list of My favourite packages from the wp-cli/package-index: billerickson/wp-cli-plugin-install-missing install any plugins that are “active” but not installed binarygary/db-checkpoint create quick db snapshots for development purposes jaywood/jw-wpcli-random-posts … Read full article →

PHP Fatal Error Uncaught Error Call to undefined function exec - WP-CLI Not Working: Call to undefined function exec()

WP-CLI Not Working: Call to undefined function exec()

For some operations such as database export, WP-CLI uses PHP exec() function which is disabled on most shared hosting servers. So if you do wp db export and no file was created, make sure to check your error_log file and if you notice this error: PHP Fatal Error: Uncaught Error: Call to undefined function exec() … Read full article →

WP CLI Tips and Tricks - WP-CLI Tips and Tricks

WP-CLI Tips and Tricks

Here are a few WP-CLI tricks and tips that might be useful: Aliases Use aliases to make commands shorter and easier to remember. You can use the –alias=<alias> flag when defining a command to specify a shorter alias for the command. For example, if you use a command wp my-command: you could define a command … Read full article →

Bulk Delete Millions of WooCommerce Products using WP CLI - 🗑️ Bulk Delete WooCommerce Products with WP CLI

🗑️ Bulk Delete WooCommerce Products with WP CLI

Here are a few useful one-liners that you can use to quickly remove all WooCommerce products from your store. Another approach: PRO TIP:If you are considering deleting items in WooCommerce, please be aware that this action cannot be undone. Once you have deleted an item, it will be permanently gone from your store. Before taking … Read full article →

wpcli autocomplete - Setup tab completions for WP-CLI

Setup tab completions for WP-CLI

Tab completion is a useful time-saving feature of command line interfaces. To enable tab completion for WP-CLI We need to edit the ~/.bash_profile file. Step 1. In your home directory download WP-CLI tab completion file Step 2. Edit your ~/.bash_profile and add the following line: source ~/wp-completion.bash Save and exit. Step 3. Source the profile … Read full article →