How to install templatemonster theme using wp-cli

Upload your template_XXXXX_XXXXXXXXXXX.zip to folder where your WordPress is installed

Unzip template_XXXXX_XXXXXXXXXXX.zip to some temporary folder.

Then find two zip files under temp_extract/theme/ folder and move them to document root directory of your website.

unzip template_XXXXX_XXXXXXXXXXX.zip -d temp_extract
mv temp_extract/theme/CherryFramework.zip ./
Read the rest

How to reinstall broken WordPress plugin using wp-cli

If you cannot execute wp-cli command due to the error generated by one of your plugins

Command:

wp plugin status

Output:

Warning: include_once(/home/username/public_html/subdomains/domain.com/wp-content/plugins/woocommerce/includes/libraries/wp-async-request.php): failed to open stream: No such file or directory in /home/username/public_html/subdomains/domain.com/wp-content/plugins/woocommerce-abandoned-cart/includes/background-processes/wcal-async-request.php on line 3

 

Just use –skip-plugins parameter along with –force

As result you will get:

wp plugin install woocommerce --skip-plugins --force

 … Read the rest

How to fix broken WordPress Elementor plugin

First of all create a backup of your website files/folders/database

cd ~/public_html

Rename broken plugin’s folder:

mv wp-content/plugins/elementor wp-content/plugins/elementor_old

Don’t worry, currently all settings are presaved in your database.

Now do reinstall of the Elementor plugin using wp-cli with –force:

wp plugin install elementor --force

Should be ok now!… Read the rest

How to remove WordPress spam users using MySQL command line

Here is described way to remove spam users you got on 2019-03

select * from wp_users where user_registered like '2019-03%';

MariaDB [db]> select * from wp_users where user_registered like '2019-03%';
15215 rows in set (0.027 sec
delete from wp_users where user_registered like '2019-03%';

MariaDB [db]> delete from wp_users where user_registered like '2019-03%';
Query OK, 15204 rows affected (0.682 sec)
Read the rest

How to remove WordPress spam users using WP-CLI

If you have a huge amount of spam users in your database you need to check this post https://alltime.pp.ua/blog/how-to-remove-wordpress-spam-users-using-mysql-command-line/ as the way below will take ‘forever’ 🙂

Supposed you’ve decided to leave just ‘administrator’

Using command below you found a pattern

wp user list

So, now run to remove them:

wp user delete $(wp user list --role=author --field=ID)
wp user delete $(wp user list --role=customer --field=ID)
wp user delete $(wp user list --role=subscriber --field=ID)

You should be asked and if you are sure just type ‘y

–reassign parameter not passed.… Read the rest

WordPress Multisite default .htaccess rules

SubFolder Example

WordPress 3.0 through 3.4.2

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*)
Read the rest

PHP settings in wp-config.php file

Edit values if needed and appended into wp-config.php file

ini_set('post_max_size', 100000);
ini_set('upload_max_filesize', 100000);
ini_set('max_input_time', 100000);
ini_set('memory_limit','1024M'); // the same as define('WP_MEMORY_LIMIT', '1024M');
set_time_limit(300);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
Read the rest