Installing WordPress using WP-CLI

Reading Time: 3 minutes

WordPress has a great GUI-based installation process however some use cases call for CLI! Or, maybe you just feel more at home in a terminal, either way this article will show you how to get your WordPress site setup with just a terminal, using WP-CLI, and maybe a sprinkle of SSH.

In order to be able to install WordPress manually using WP-CLI you will first need to create a new database for the WordPress install. You will need to know how to find your SSH credentials as well as being used to using Terminal or Putty and WP-CLI.

Continue reading “Installing WordPress using WP-CLI”

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 minutesIf 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 minutesThere 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 minutesThere 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. Continue reading “How To Delete Post Revisions using WP-CLI”

How To Verify WordPress Checksums Using WP-CLI

Reading Time: 2 minutesIf 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). Continue reading “How To Verify WordPress Checksums Using WP-CLI”

How to Migrate from Shopify to WooCommerce

Reading Time: 3 minutesShopify 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 minutesThere 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 minuteslets 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. Continue reading “How to Use Let’s Encrypt with Cloudflare”