Overview
This tutorial demonstrates how to generate WordPress Pages from a simple CSV file comprising of locations.
Prerequisites
We’ll be using a specific Theme and Plugins in this tutorial, but you’re free to use any Themes or Plugins as part of your site building process.
- Your server meets all hosting requirements and is configured correctly
- WordPress: Latest Version
- Theme: WordPress Twenty Twenty
- Plugins:
- CSV File:
- We’ll be using a CSV File comprising of locations which can be downloaded here.
Create Keyword
First, we’ll import our CSV file into a Keyword. Navigate to Page Generator Pro > Keywords in the WordPress Administration menu:
Click the Import CSV button below the Page Generator Pro title, which can be found towards the top of the screen:
Define the following options on the form:
- CSV File:
- Click Choose file (or similar), and select the CSV File from your computer.
- Import Method: Import Columns into a single Keyword
- Delimiter: ,
- Keyword Name: location
Click the Save button.
A notification will be displayed confirming that the Keyword saved successfully.
Creating Content
Next, we’ll create a Content Group (a template) which will be used to generate the WordPress Pages, using the CSV file data we’ve stored in the location Keyword. Navigate to Page Generator Pro > Generate Content in the WordPress Administration menu:
Click the Add New button below the Content Groups title, which can be found towards the top of the screen:
You will then be presented with a screen similar to the one used to edit your WordPress Posts and Pages:
Title
Let’s start by defining the title that we want for each of our Pages. As we want to generate a WordPress Page for each location specified in our Keyword, we need to include the location Keyword.
Click on the Insert Keyword dropdown on the top right of the Title field, and click location
This will insert the location keyword into the Title field.
This location keyword will be replaced by a unique term for each Page that’s generated. Taking our example CSV file, this means the following Pages would be generated with the following Titles:
- Acocks Green, West Midlands
- Alderman’s Green, West Midlands
- Aldridge, West Midlands
- etc.
Content
Define the content required for the WordPress Pages. Again, the {location} Keyword can be used, in the same way that we did in the Title above:
Permalink
By default, WordPress will generate a Permalink based on the Title. However, we can control the precise Permalink used by manually enter a Permalink now. It’s also best practice to always define a Permalink in a Content Group.
To do this, enter {location} into the Permalink text field:
Generate
There are a few different ways that we can generate content, each of which are based on the keywords that we’re using:
Method | Description |
---|---|
All | The All method generates Pages for all possible unique combinations of the keywords specified in the Content Group. This would ensure that every service and location combination has its own unique Page. |
Sequential | The Sequential method honors the precise order of each keyword’s terms. This would mean that the first service and first location would be used for the first page, the second service and second location would be used for the second page, and so on. |
Random | The Random method generates Pages, choosing a term from each keyword at random for each Page that is generated. |
We want to use the All method, to ensure no Keyword Terms are missed.
Overwrite
The Overwrite option allows us to overwrite existing Pages that were previously generated by this Group, matching the Permalink. This is useful if we need to re-generate our Pages because we fix a typo, or change the content, and don’t want to end up with duplicate Pages describing the same service and location.
Set this option to Yes, if existing Page Generated by this Group
Actions
With our Title, Content and Permalink completed, plus the publish and generation settings confirmed, let’s save our Content Group before starting content generation.
In the Actions box, click the Save button:
The screen will update, confirming that the Content Group has been published (or updated, if we’re saving an existing Content Group):
Testing Content
With our Content Group saved, we’re almost ready to generate our content.
Before we do this, it is be a good idea to test the content and settings by generating a single Page in draft mode. This ensures that the Page isn’t made available to web site visitors, in case we spot any issues and need to change settings or content in our Content Group.
To do this, in the Actions box, click the Test button:
Confirm that we want to generate a single Page in draft mode by clicking OK.
After a few moments, the screen will update, confirming that a Test Page has been generated. The notification also tells us the terms that were used to replace the keywords:
Let’s click the link in the notification, which takes us to the draft Page:
Generating Content
If we’re happy with our Test Page, we can now go ahead and generate all of our Pages. To do this, click the Generate button in the Actions section of the screen:
A new screen will appear, showing a progress bar and log. As each page generates, the progress bar and log will update:
Once all WordPress Pages have been generated, we can view them by:
- Navigating to Page Generator Pro > Generate Content in the WordPress Administration menu:
- For the Content Group, click the View Generated Content link
The Generated Pages are then listed in the Pages section of WordPress.
Conclusion
This tutorial has covered the basics of using Page Generator Pro to:
- Define a Keyword,
- Produce a Content Group (template) comprising of Page content that we want to output across all generated Pages,
- Applied Keywords for each of our generated Pages,
- Familiarised ourselves with how to Test Generate a Page,
- Use the Generate via Browser functionality to generate all WordPress Pages from our Content Group.
There’s much more that Page Generator Pro can do, so be sure to check out the Documentation and any other Tutorials.