New Ways to Change active WordPress theme - Different Ways to Change active WordPress theme

Different Ways to Change active WordPress theme

Here are a few ways you can change the active theme in WordPress: Using WP Dashboard Using the WordPress Administration Screens: You can change the active theme by going to the “Appearance” -> “Themes” page in the WordPress Administration Screens and selecting a new theme. Using functions.php or a custom plugin Using the wp_set_theme function: … 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 →

Reset WordPress password from the command line - Reset WordPress password from the command line

Reset WordPress password from the command line

1. log in to the MySQL: mysql -u root -p; 2. Select the database: use database_name; 3. List all users: select * from wp_users\G 4. Change the password for the user you require: UPDATE wp_users SET user_pass=MD5(‘new_password_here’) where ID=user_id_here;

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 →

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 →

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 →

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 →

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 →