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 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.

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.

What are Common Commands to Update WordPress Using WP-CLI?

Reading Time: 2 minutes

WP-CLI is a very handy set of commands. You can run anything that you would run in wp-admin on a WordPress site but from the command line. Useful commands which WP-CLI employs to keep WordPress core updated plugins including the default themes which come with WordPress.

Continue reading “What are Common Commands to Update WordPress Using WP-CLI?”

Migration to Managed WooCommerce

Reading Time: 2 minutes

Liquid Web is here to support your migration needs into our Managed WooCommerce Hosting platform. Whether you are migrating from an external or internal source, our in-house team of migration experts transforms the data migration process into a simple task. To ensure the smoothest and best possible data transfer, we have a quick overview and a few points for your consideration.  Continue reading “Migration to Managed WooCommerce”

Automatically Restore Stock Levels After Cancellation

Reading Time: < 1 minute

If you’re selling physical products with your WooCommerce store, you already know that accurate inventory counts are really important. You need to know how many t-shirts you have on hand, or if it’s time to restock specialty items after a big sale. With WooCommerce, it’s easy to see how much you’ve sold on your store and watch stock levels. 

When an order is cancelled or refunded, is there a way to have the stock level restored automatically on a WooCommerce store?

Continue reading “Automatically Restore Stock Levels After Cancellation”

Offering Free Products on Your WooCommerce Store

Reading Time: 2 minutes

Did you know that offering free products or downloads can be a great way to increase your growing business? It might seem counter intuitive at first, but a great free offering can help get your name out there. It creates an opportunity for new customers to get to know you, and sing your praises, and then tell others about your products.

If I offer free products on my store, how do I remove unnecessary fields to make the checkout easier for those customers?

Continue reading “Offering Free Products on Your WooCommerce Store”