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 →

wpcli password reset - Reset WordPress user password using WP-CLI

Reset WordPress user password using WP-CLI

In this guide We’ll cover how to reset a WordPress user password using WP-CLI. Step 1. Ensure WP-CLI is installed and you are in the website directory run the following command to check if you are in the right folder: Step 2. List all users and note user_login for the user Step 3. Replace the … Read full article →

Download older Plugin Versions from WordPress.org  - Download older Plugin Versions from WordPress.org

Download older Plugin Versions from WordPress.org

You can download older versions of any plugin hosted on WordPress.org directly from the website or from WP-CLI. To download older plugin versions from WordPress.org click on the Advanced view link scroll down to the end of the page and under Previous Versions select the version that you would like to download. that’s it! Another … 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 →

wpcli regex search - Use Regex with WP CLI to 🔎 Search & Replace in Database

Use Regex with WP CLI to 🔎 Search & Replace in Database

When cleaning websites that have large databases, regular text editors can’t even open the database dumps (Notepad++ supports files up to 2GB in size). So to run a search and replace on large database dumps I suggest using regex-replace line-by-line in PHP, or setting up WPCLI and running regex search & replace. Here is a … Read full article →

wp core - Reinstall WordPress Core using WP-CLI

Reinstall WordPress Core using WP-CLI

We recently made a list of the most useful WP-CLI commands with examples and how to fix the most common WPCLI errors but there are a lot of maintenance tasks that can be done with WP-CLI that We haven’t included in this list. One of those tasks is reinstalling WordPress Core using WP-CLI. Step 1. … 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 →

wpcli shortcodes - List all shortcodes from all WordPress posts with WPCLI

List all shortcodes from all WordPress posts with WPCLI

If you used shortcodes from a certain plugin or a theme and then stop using either one, then chances are that you still have shortcodes that no longer translate into anything. In this guide We will be using WP CLI Shortcode scrapper package to find all shortcodes in the database. This command works by searching … Read full article →