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 →

Reinstall WordPress Core using WP CLI - Reinstall WordPress Core using WP-CLI

Reinstall WordPress Core using WP-CLI

Useful WP-CLI commands that I use when cleaning hacked WordPress websites in order to reinstall WP core, all themes, and plugins from WordPress.org

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 →

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 →

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 →

Reinstall all WordPress plugins using WP CLI - Reinstall all WordPress plugins using WP-CLI

Reinstall all WordPress plugins using WP-CLI

Here is a convenient WP-CLI command that I use when cleaning hacked WordPress websites in order to reinstall all plugins from WordPress.org It consists of two commands: get a list of all active plugins, then force reinstall for each plugin. To reinstall all WordPress themes in the same manner use:

wpcli custom php version - Download WP-CLI & set custom PHP Version

Download WP-CLI & set custom PHP Version

Recently I was migrating a website from GoDaddy shared hosting using WP-CLI and noticed the PHP version in cli was outdated. Here is how to install WP-CLI and set custom PHP version for the cli. Setup WP-CLI To download WP cli: To run it use php wp-cli.phar To make it easier to call We’ll rename … Read full article →

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 →