Update: Migrating to Liquid Web with Managed WordPress Portal

Reading Time: 4 minutes
Note:
The instructions in this tutorial are for the Managed WordPress portal clients. These instructions do not apply if you have a Liquid Web WordPress Server Optimized Template account.

Migrations to Liquid Web’s Managed WordPress and Managed WooCommerce portals are made easy using a custom plugin called Migrate To Liquid Web created specifically for Liquid Web by BlogVault. With this plugin, you can migrate any WordPress site into your portal in just a few easy steps. Continue reading “Update: Migrating to Liquid Web with Managed WordPress Portal”

Best Practices For Changing Your Email Marketing Provider

Reading Time: 3 minutes

If you are using one of our Managed application platforms like ManagedWooComerce or Managed WordPress, now may be an optimal time to look into switching your email provider to a different service.

managed email

MailChimp made a change earlier in the year to become more of a marketing platform, which was also accompanied by a pricing increase in their plans. Due to this change, we have reviewed several reliable options which may make choosing a replacement easier! We considered three other services which may be a better alternative; they are EmailOctopus, Moosend, and MailBuster. 

Continue reading “Best Practices For Changing Your Email Marketing Provider”

How To Use the Image Optimizer Package for WP-CLI

Reading Time: 2 minutes

There will be many times when you will need to optimize all images in a site media library. If you are familiar with using WP-CLI, then there is a very handy package which can be installed. The package is called “image-optimize” and it will simplify the process of getting your images ready for web hosting.

This package is not for “managed hosts” since the libraries needed will not be able to be installed having without root access and it can be CPU resource intensive.

Preparing to Run Commands

The package for WP-CLI is called image-optimize. To be able to use this package, you will need to login to your site’s server and update WP-CLI. You can update WP-CLI by running the following command:

wp cli update

Next, you will need to install a number of libraries that the package uses to optimizes jpeg, png and gif images with these commands:

sudo apt-get install jpegoptim
sudo apt-get install optipng
sudo apt-get install pngquant
sudo apt-get install gifsicle

Now you can install the stable version of the image-optimize package with this command:

wp package install typisttech/image-optimize-command:@stable

Optimizing Site Images

The following are examples of the commands to run after a WordPress core update:

wp image-optimize mu-plugins
wp image-optimize plugins
wp image-optimize themes
wp image-optimize wp-admin
wp image-optimize wp-includes

You can use this command to regenerate all thumbnails on a site.

wp media regenerate --yes
You may need to limit how many images that image-optimize will process in a single back. To limit the batch size,  you just need to add the –limit flag to the end of the batch command and specify the amount, as shown in these examples:

wp image-optimize batch --limit=500
wp image-optimize batch --limit=1000
wp image-optimize batch --limit=2500
wp image-optimize batch --limit=5000

When using the image-optimize WP-CLI command, server CPU usage may be intensive, so run the batch commands in smaller sizes during the off hours times on your site. You can track CPU usage whilst running a batch optimize command by using htop. You can install and run htop using the following commands:

sudo apt-get install htop
htop

To use htop to monitor server load, keep a terminal window open while the batch optimize command is running in another terminal window. In our testing, the CPU usage was not too high.

1.61GB/3.74GB Memory usage
180M - 3.86GB Swap

Restoring Optimized Images

Before images are optimized backup versions are created, which means that you can restore at any time to a backup file and replace out the optimized version.

For example, Attachment 123 was optimized using this command:
wp image-optimize attachment 123

To restore the attachment for 123 the command to run would be:
wp image-optimize restore 123

You can use the wp media regenerate command to regenerate a specific media file.
wp media regenerate 123

 

Being able to  optimize the images in your WordPress sites media library will reduce the amount of storage needed for your site. Optimization will also improve the speed and performance of your site for visitors, improving user experience and satisfaction.

How To Delete Post Revisions using WP-CLI

Reading Time: 2 minutes

There may be times when you need to clean up post revisions created on your site. This is possible, using the commands already available in WP-CLI.

WP-CLI has a wp post delete command which can be used to delete post revisions. Post revisions are changes made to content on your site, over time those post revisions on your site can mount up. The following directions assume you are using one of Liquid Web’s Managed WordPress or Managed WooCommerce products. You can also use these techniques with other WordPress installations, just be sure to run the commands from the primary WordPress installation folder.

Preparing to Run Commands

One of the first steps will be to generate sFTP/SSH credentials from your site manager. You can use Terminal on the Mac, or Putty on a PC to use WP-CLI. For more information about logging into your server using SSH, see Logging into Your Server via Secure Shell (SSH).

Log in, then go to the WordPress installation folder by entering:

cd html

It is always a good idea to create a database backup before making significant changes to your site, like bulk deleting post revisions. To create a manual backup run this command:

wp db export

You can now use gzip to compress the resulting sql file which will mean a smaller file being stored on your server:

gzip sitebackup.sql

Cleaning Up Your Post Revisions

To delete post all revisions (moving them temporarily into the trash), use this WP-CLI command:

wp post delete $(wp post list --post_type='revision' --format=ids)

To delete the post revisions which have been moved to the trash (this includes all post revisions which have a post status of trash), run this command:

wp post delete $(wp post list --post_type='revision' --format=ids --force)

You can skip the first step of moving the posts to the trash by just running the second command. This will remove all post revisions, both those in the trash and those that are in the active portion of the site.

More Control Over Post Revisions Removal

If you need more control of deleting post revisions, there is a package which can be installed from a third-party for WP-CLI. Please note: This package is not provide by Liquid Web nor is it endorsed by Liquid Web. Please use at your own discretion.

To install the package for WP-CLI, run the following command:

wp package install trepmal/wp-revisions-cli

After the package WP Revisions has been installed, to clean all post revisions, you can use the following command. Please note: this command can be slow, since it will query post revisions before deleting them.

wp revisions clean -1

If you wanted to delete all post revisions before a specific date, you can include that in the command. For example:

wp revisions clean --before-date=2019-06-10

If you needed to clean all post revisions other than those for a specific post type, include that post type at the end of the command. For example, revisions for the WooCommerce created product post type would not be deleted if you run this command:

wp revisions clean --post_type=product

For a faster method to delete all post revisions, you can run this command:

wp revisions dump --hard

To list all existing post revisions, you can run this command:

wp revisions list

Easily deleting post revisions from your site database will help keep the database cleaned up. Streamlining the database can result in performance improvements, especially as the size of the database grows.

How To Verify WordPress Checksums Using WP-CLI

Reading Time: 2 minutes

If you do not keep site plugins updated along with WordPress core updated, then you run into the chance of your site being hacked or infected by Malware. If your site does get infected by malware, a way to easily find any of the non-standard WordPress core and plugin files is by using the verify checksums commands in WP-CLI (the WordPress Command Line Interface).

Preparing to Run Commands

First, you will need to login to your portal via SSH. For directions on generating credentials for sFTP/SSH creds from your site manager, see Finding Your SFTP/SSH Credentials in Managed WordPress Portal. For help using SSH, see Logging into Your Server via Secure Shell (SSH).

Getting Started

Security plugins have definite uses, but when you need to verify WordPress core as well as all installed plugins on the WordPress.org checksums, plugins are just not the appropriate tool. WP-CLI already has checksum commands for both WordPress core and all plugins.

Checksums Commands

  • To verify that all WordPress core files checksum match, the WP-CLI command to run is:

wp core verify-checksums

  • To verify checksum against specific versions of WordPress, you can include the version number in the command. To verify for version 5.2.1 of WordPress core, for example, the command would be:

wp core verify-checksums --version=5.2.1

  • If you were using an older version of WordPress, for example version 4.9.10, the command would be:

wp core verify-checksums --version=4.9.10

  • To verify the checksum of all plugins which are installed on your site server (this would only include plugins available from WordPress), then the command to run would be:

wp plugin verify-checksums --all

  • To verify the checksums of a specific plugin (e.g., WooCommerce), you will need to know the plugin “slug” (or short name). You can find the slug by looking in the plugins links on the WordPress website.

The plugin slug for WooCommerce is woocommerce, so to verify the checksums of the WooCommerce plugin, the command would be;

wp plugin verify-checksum woocommerce

Summing Up

The files that the core verify checksum or the plugin verify checksum commands in WP-CLI will display will be any of the non-standard PHP or other files that should not exist in WordPress folders. The files should be deleted (it’s always a good idea to take backups before deleting data from your server). and then you can rerun the same verify checksums commands to check that there are no other files which should not exist on your site server.

Knowing how to verify the checksums of WordPress core files, all plugins installed from WordPress.org, and specific plugins installed from WordPress.org using simple-to-use WP-CLI commands will give you peace of mind in knowing that there are no non-standard files that exist in those folder directories.

How to Migrate from Shopify to WooCommerce

Reading Time: 3 minutes

Shopify is a hosted e-commerce platform which can make setting up a store easy for most customers. Unfortunately, Shopify can get expensive when you need to scale up, plus there is a cost per transaction for each order. WooCommerce is an open plugin which can be installed on your existing WordPress site which, along with other plugins, will turn your store into a fully fledged eCommerce store. You can also get a fully-managed WordPress/WooCommerce store with Liquid Web’s Managed WooCommerce Product.

If you did start your store on Shopify, but you now want to migrate to using WooCommerce, you’ll need to export your existing store data, customers, orders and products out from Shopify and then import all of that data into your new WooCommerce store.

Step #1 – Export your Data from Shopify

Shopify does have help posts which cover customers, orders, and products and how you can export those each out to CSV files.

Step #2 – Import Your Data into WooCommerce

Now that you have the store data, how do you get that data imported into your WooCommerce store? WooCommerce does have a native CSV importer for products which can be of use, but it has certain limits. If you have to import a number of CSV files, you’ll need to map each of the fields in the CSV for each part of the product import (like the product title and product SKU, for instance). To import a CSV file, go to WooCommerce > Products and select Import. Choose the CSV file, confirm all of the field mapping, then run the importer.

woocommerce import/export screenshot

Alternative – Use WP All Import

If you’d rather not manually map all of the fields for each import, there is an excellent paid plugin for WordPress which will allow you to import in customers, orders, and products. It’s WP All Import and has add-on plugins for users and WooCommerce. The WooCommerce add-on will allow you to import products, and orders and the user’s add-on will allow you to import in customers. You’ll need to purchase and install the WP All Import plugin to proceed with these directions.

To make the process easier WP All Import allows you to create templates. Since we are importing products in this article, we’ve created a template to map all of the product fields for a product import. To import products using this template, save this template as a TXT file.

Open the plug in and go to All Import > Settings. In the Import/Export Templates section, select the text template file and import it. After the template file has been imported correctly, you will see there is now a template file.

import template screenshot

To import your product CSV export from Shopify in WP All Import go to All Import > New Import.  Select the CSV file and then select New Items and select the  WooCommerce Products type.

continue to step 2

Confirm the number of rows to imported and then continue to Step 3.

number of rows to be imported screenshot

Scroll to the bottom of the page, and select Load Template. Next, select the Shopify product template. This indicates that all fields in the CSV have been mapped correctly to import products into WooCommerce.

Now you can continue and all products which were exported from the Shopify store will be imported into WooCommerce. The images used on the store on Shopify will be imported into the store’s media library during the import, and then mapped into the product. The products will contain the correct data, as well as the featured image.

Customers and orders can also be exported from Shopify as CSV files. Customers can be imported using WP All Import Pro, with the user’s add-on, and orders can be imported using the WP All Import Pro Woocommerce add-on. This only covers retrieving the data from Shopify, then importing into WooCommerce. The theme used on the Shopify store can not be used, but you can replicate the look of the store by using a solid combo of Astra as the theme, then add any specific landing page elements using Beaver Builder page builder.

Bulk Delete Pending Payment Orders In MWCH

Reading Time: 2 minutes

There may be times when bulk deleting orders becomes necessary, such as orders which have been moved to the trash, or orders with the status of payment pending on a store. Deleting orders from wp-admin can be a slow, tedious process, even if you increase the number of orders that load at one time from the default value of 20 in the screen options.

This is where using the WP-CLI comes in handy, using the wp post delete command (for detailed directions on this command, see wp post delete).

Preparing to Run Commands

First, you will need to login to your portal via SSH. For directions on generating credentials for sFTP/SSH creds from your site manager, see Finding Your SFTP/SSH Credentials in Managed WordPress Portal. For help using SSH, see Logging into Your Server via Secure Shell (SSH).

  1. Log in, then enter:

cd html

This will change the directory to the html directory where you can run the WP-CLI commands.

  1. To create a database backup before bulk deleting pending payment orders, run this command;

wp db export

  1. You can use the gzip compress down the resulting sql file.

gzip sitebackup.sql

Cleaning Up Your Pending Orders

  1. To completely delete only orders which have a post status of wc-pending, using this WP-CLI command;

wp post delete $(wp post list --post_type='shop_order' --post_status=wc-pending --format=ids --force)

  1. If you do not want to skip moving those orders to the trash, you can run this command;

wp post delete $(wp post list --post_type='shop_order' --post_status=wc-pending --format=ids)

  1. To delete any orders which have been moved to the trash, essentially “emptying the trash folder”, run this command;

wp post delete $(wp post list --post_type='shop_order' --post_status=trash --format=ids --force)

Using the WP-CLI command will be a much faster method than trying to manually bulk delete those orders from wp-admin on the site, saving you time to spend on the real work of running your business. See our website for more information about our Managed WooCommerce Hosting.

How to Use Let’s Encrypt with Cloudflare

Reading Time: 3 minutes

lets encrypt logo

Cloudflare is an excellent and well-known content delivery network. A CDN can increase site speed by utilizing Cloudflare’s global caching network to deliver content closer to a visitor’s location.

You can also easily attach Cloudflare as an add-on product to your existing Liquid Web server, but there are some configurations to consider.

cloudflare logo

Continue reading “How to Use Let’s Encrypt with Cloudflare”

Resolving WooCommerce Plugin and Theme Issues

Reading Time: 3 minutes

What is WooCommerce?

WooCommerce is a WordPress based plugin used by many small to medium sized businesses for building, tracking and maintaining an easy to use e-commerce solution. Because WooCommerce is updated regularly with new releases, online sellers can add new and existing features frequently, along with resolving any known bugs or security vulnerabilities. WooCommerce is actively installed on over 4 million WordPress sites and is used to drive e-commerce sales on a significant number of websites.
Continue reading “Resolving WooCommerce Plugin and Theme Issues”

Delete Posts and Comments from Action Scheduler

Reading Time: 2 minutes

The Action Scheduler is a background processing, queue job runner which is built into WooCommerce core. A number of plugins use the Action Scheduler, WooCommerce Subscriptions and WooCommerce Follow-Ups being two of the best known.

WP-CLI makes it easy to delete posts and comments which have been created by the Action Scheduler in WooCommerce. There may be cases where the Action Scheduler might create a large number of posts and comments on your live site, and you want to clear up the data from the site’s database.

 

Delete Comments from Action Scheduler

To delete comments created by the Action Scheduler, you can run this command:

wp comment list --field=comment_ID --'post_author'='ActionScheduler' --number=1000 | xargs wp comment delete --forceThe number can be increased if you have more comments that need to be deleted to 2000 or higher.

Delete Bulk Posts from Action Scheduler

To delete all of the scheduled-action posts, you can run this command:

wp post list --field=ID --post_type=scheduled-action --posts_per_page=1000 | xargs wp post delete --forceThe number can be increased if you have more posts that need to be deleted to say 2000 or higher.

Delete Scheduled Action Posts

To delete all of the scheduled-action posts with a post status of trash, you can run this command:

wp post list --field=ID --post_type=scheduled-action --posts_per_page=1000 --post_status=trash | xargs wp post delete --force

Delete Bulk Scheduled Actions

To delete all of the scheduled-action posts with a post status of cancel,  you can run this command:

wp post list --field=ID --post_type=scheduled-action --posts_per_page=1000 --post_status=cancel | xargs wp post delete --force

 

Using a mix of these commands, you will be able to delete posts and comments easily, using WP-CLI on your site. It will also keep your site database clean, allowing it to run more efficiently.  Take the work out of maintaining your WordPress site with our Managed WooCommerce product.  Our WooCommerce platform comes with free iThemes plugins curated especially for online stores.