WordPress Integration

Improve performance for a website powered by a WordPress instance by proxying traffic through Edgio. This reduces latency by allowing your website content to be cached across our global network. It also empowers you to securely deliver your website content and to take advantage of other performance enhancements, such as Predictive Prefetching. Finally, you may manage cached website content from within your WordPress control panel through our free WordPress plugin.

What is WordPress?

WordPress is a content management system (CMS) that allows you to host and build websites. WordPress contains plugin architecture and a template system, so you can customize any website to fit your business, blog, portfolio, or online store.

System Requirements

Sign up for Edgio

Deploying requires an account on Edgio. Sign up here for free.

Install the Edgio CLI

If you have not already done so, install the Edgio CLI.

With npm:

1npm i -g @edgio/cli

With yarn:

1yarn global add @edgio/cli

Getting Started

Create a new WordPress site

If you don’t already have a WordPress site, create one by following the official WordPress.com guide. You may also use other WordPress providers, but setup instructions may differ.

Create via Edgio Developer Console

  1. First, login to the Developer Console and locate the New Site button.
New Site button
  1. Next, enter your WordPress site’s domain name. This will eventually become the origin backend that you will proxy to once your site is setup.
Add New Site dialog
  1. Once your site is created, copy the generated command into your terminal (💻) and run it at the root of your project. This will initialize your project source code with Edgio and automatically deploy your site. If you do not have your WordPress source code locally, choose the Create a new directory option from the CLI.
Quick Start Deploy Command

An example command for www.yourdomain.com:

1npx @edgio/cli@latest init \
2 --name yourdomain.com \
3 --environment production \
4 --origin www.yourdomain.com \
5 --deploy
  1. Finally, you can start to update your Edgio router (routes.js) and configuration file (edgio.config.js) to proxy your origin and setup caching rules.

Run the WordPress app locally on Edgio

Test your app with the Sites on your local machine by running the following command in your project’s root directory:

1edgio dev

Load the site


Create a production build of your app by running the following in your project’s root directory:

1edgio build

Deploy your app to the Sites by running the following command in your project’s root directory:

1edgio deploy

Refer to the Deployments guide for more information on the deploy command and its options.

Direct Traffic to Sites

Once you have confirmed that your deployed Edgio site is proxying content from your hosted WordPress site, you may go back to your site in the Developer Console and follow the instructions on configuring your production DNS to point to Edgio. Refer to the Custom Domains and SSL guide for additional details.

WordPress Plugin

Edgio provides a WordPress plugin you may leverage to automatically clear the Edgio cache when a change is made to your site.

First, to obtain the latest plugin version, click here to download the ZIP file.

Next, in your WordPress control panel, navigate to the Plugins page and click Upload. Navigate to your local download directory and select the edgio.zip file for upload.

plugins page

Once the plugin has been uploaded, click Manage Plugin.

manage plugin

Navigate to Settings > Edgio to pull up the form for the required information. You may see errors indicating that the Edgio plugin is missing information.

plugin settings

In order for the plugin to be able to interact with the Sites, you’ll need to provide the following:

  • Environment Name
  • API Key
plugin fields

Environment Name refers to the Edgio environment as defined in the Developer Console for your site. This value will typically be default or production depending on how your site is setup, but can be any valid environment that you have created.

To obtain the API Key, go to your site within the Edgio Developer Console. Click Settings > Create new Deploy Token and enter in a name for the token.

plugin fields

Once created, copy the token to the API Key field of the WordPress plugin. After you’ve completed all the fields, click Save Changes.

Lastly, test the behavior by clicking Clear Cache. You can validate the cache clearing was successful by checking the Activity tab of your site:

purge activity