Keywords

Overview

Keywords can be seen as template tags, with each Keyword comprising of one or more Terms.

For example, we might have a keyword called service, describing the services that our plumbing business offers.  Its terms could be:

  • bathroom installations
  • fixing leaks
  • central heating installation

There’s no limit to the number of terms a Keyword can have.

Keywords are then used throughout your Content Groups.  A Content Group defines a content template, from which Page Generator Pro will generate your Pages, Posts and/or Custom Post Types.
Page Generator Pro: Keywords: Example {service} Keyword in Content Group

For each generated Page, Post or Custom Post Type, a different Term within each Keyword will be used.

Don’t worry if this conceptual structure doesn’t make sense immediately; working through the Documentation will join these concepts up, explaining them in more detail.

To access your Keywords, click on the Page Generator Pro menu entry in the WordPress Administration interface, and then click on Keywords.
Page Generator Pro: Keywords Menu

Adding / Editing Keywords

To add a Keyword to Page Generator Pro, click the Add Keyword button below the Page Generator Pro: Keywords title, which can be found towards the top of the screen:
Page Generator Pro: Import CSV

To edit an existing Keyword, click the Keyword in the table:
Page Generator Pro: Keywords: Edit

The Keyword form will then be displayed, where you can define various options.

  • Keyword: the unique template tag you’ll use when generating Pages / Posts / Custom Post Types.
    • The Keyword must be unique from any other Keywords that you might have already defined.
    • Make sure to only use letters, numbers and underscores.  Spaces and other characters will not work.
    • The Keyword cannot just be numbers

The remaining options depend on the Source selection, described below.

Adding / Editing Keywords: Sources

Sources are available in Page Generator Pro 3.0.8, releasing Thursday 25th February 2021.  Any versions prior to this treat all Keywords as being a Local source

When adding a Keyword, the option to define a source is available.

This source tells Page Generator Pro where to fetch the Terms from.

Source Description
Local The Keyword’s Terms are defined in the Keyword itself, and can be added/edited through the Keyword Form.
Airtable The Keyword’s Terms are defined in an Airtable Base Table
CSV File The Keyword’s Terms are defined in a CSV File that is uploaded to the WordPress Media Library
CSV URL The Keyword’s Terms are defined in a CSV file that’s remotely accessible via a direct URL (such as a Google Sheet)
Database The Keyword’s Terms are defined in a database table
RSS Feed The Keyword’s Terms are defined in an RSS Feed

Changes made to data stored any non-local source will be fetched every time you Generate Content or Terms.  Therefore, it’s useful to define a CSV File, URL or Database source if you prefer to define your Keyword Terms in a file/database table that you commonly work on, instead of having to import the CSV/database table every time a change is made.

Adding / Editing Keywords: Source: Local

Terms cannot exceed 16mb in size. If they do, store the Terms in a remotely hosted CSV file and use the CSV URL or CSV File options instead.

When Source is set as local, the following option are displayed when adding or editing a Keyword on the Keyword form:
Page Generator Pro: Keywords: Source: Local

  • Terms: The words or phrases that will be cycled through when generating content containing this Keyword.  Each word or phrase must be on its own line.
  • Delimiter: If the Terms contain deliniated data, define the delimiter here.  This is covered more in the Understanding Delimiter and Columns section below.
  • Columns: If the Terms contain deliniated data, define column names here.  This is covered more in the Understanding Delimiter and Columns section below.
  • Text File Import:
    • If you already have a list of Terms that you want to use for a Keyword in a text file, upload your file here.
    • This will append the data to the end of the Terms field – so any existing Terms that you might have specified above will remain.

If no Terms are specified, Page Generator Pro will attempt to automatically populate the list of Terms for you based on the Keyword supplied.  For example, defining a Keyword called love with no Terms produces the following:

Page Generator Pro: Keywords: Automatic Terms

Adding / Editing Keywords: Source: Airtable

Airtable is available in Page Generator Pro 3.3.4, releasing Thursday 22nd July 2021.
This option is only displayed when the API Key has been specified in the Integration Settings.

When Source is set as Airtable, the following option are displayed when adding or editing a Keyword on the Keyword form:
Page Generator Pro: Keywords: Airtable Form

  • Base ID: The Airtable Base (spreadsheet) to use as the source of Keyword Data.  To obtain your Base ID:
    • Visit https://airtable.com/api
    • Select the Base (spreadsheet)
      Page Generator Pro: Keywords: Airtable: Select Base
    • Make a note of the Base ID, entering it into the Base ID field
      Page Generator Pro: Keywords: Base ID
  • Table Name: The Airtable Base’s table to use as the source of Keyword Data.  To obtain your Table Name:
    • View the Airtable base at airtable.com
    • Note the name of the applicable table in the tab
      Page Generator Pro: Keywords: Airtable: Select Table Name

Adding / Editing Keywords: Source: CSV File

Sources are available in Page Generator Pro 3.0.8, releasing Thursday 25th February 2021.  Any versions prior to this treat all Keywords as being a Local source

When Source is set as CSV File, the following option are displayed when adding or editing a Keyword on the Keyword form:
Page Generator Pro: Keywords: Source: CSV File

  • CSV File: The CSV File in the Media Library to use as the source of Terms
    • Click the Choose File from Media Library button, and then either:
      • Upload the CSV File to the Media Library by dragging and dropping onto the modal window, and/or
      • Select the existing/uploaded CSV File in the Media Library
  • Columns in First Row:
    • If enabled, the first row’s values will be used as the Keyword’s Column Names.  The CSV file must comprise of the following example structure:
      Page Generator Pro: Import Keywords: Import Columns into Single Keyword
    • Columns and Delimiters are covered in the Understanding Delimiter and Columns section below.
  • Delimiter: If the CSV’s first row contains column names, specify the delimiter used in the CSV file.  Typically this is a comma.
The CSV File must remain in the Media Library for Generate Content and Generate Terms functionality to work with this Keyword.  If this isn’t possible, use the Import CSV functionality to import your CSV File(s) as local source Keywords, where Terms are then stored in the Keyword itself.

Adding / Editing Keywords: Source: CSV URL

Sources are available in Page Generator Pro 3.0.8, releasing Thursday 25th February 2021.  Any versions prior to this treat all Keywords as being a Local source

When Source is set as CSV URL, the following option are displayed when adding or editing a Keyword on the Keyword form:
Page Generator Pro: Keywords: Source: CSV URL

  • CSV URL: The direct URL to the CSV file.
    • This must be a publicly accessible URL
  • Columns in First Row:
    • If enabled, the first row’s values will be used as the Keyword’s Column Names.  The CSV file must comprise of the following example structure:
      Page Generator Pro: Import Keywords: Import Columns into Single Keyword
    • Columns and Delimiters are covered in the Understanding Delimiter and Columns section below.
  • Delimiter: If the CSV’s first row contains column names, specify the delimiter used in the CSV file.  Typically this is a comma.
The CSV URL must remain publicly accessible for Generate Content and Generate Terms functionality to work with this Keyword.  If this isn’t possible, download the CSV URL, and then use the Import CSV functionality to import your CSV File(s) as local source Keywords, where Terms are then stored in the Keyword itself.

Google Sheets

To use a Google Sheets Document as the source:

  • Open the Google Sheets Document in your web browser
  • Click the Share button
    Page Generator Pro: Keywords: Source: Google Sheets: Share
  • Click the Change link in the Get link section
    Page Generator Pro: Keywords: Source: Google Sheets: Change
  • Click the dropdown, and select Anyone with the link
    Page Generator Pro: Keywords: Source: Google Sheets: Access
  • Confirm that the right hand dropdown is set to Viewer, to ensure non-authenticated users can only view the data, and not edit it:
    Page Generator Pro: Keywords: Source: Google Sheets: Viewer
  • Click the Copy link button
    Page Generator Pro: Keywords: Source: Google Sheets: Copy Link
  • Paste the link into the CSV URL field of the Keyword in Page Generator Pro
    Page Generator Pro: Keywords: Source: Google Sheets: CSV URL
The delimiter for Google Sheets should always be a comma.

Adding / Editing Keywords: Source: Database

Sources are available in Page Generator Pro 3.0.8, releasing Thursday 25th February 2021.  Any versions prior to this treat all Keywords as being a Local source

When Source is set as Database, the following option are displayed when adding or editing a Keyword on the Keyword form:
Page Generator Pro: Keywords: Source: Database

  • Table: The database table to use as Terms for this Keyword.
The database table must remain existing for Generate Content and Generate Terms functionality to work with this Keyword.  If this isn’t possible, export your database table to a CSV File, and then use the Import CSV functionality to import your CSV File(s) as local source Keywords, where Terms are then stored in the Keyword itself.

Adding / Editing Keywords: Source: RSS Feed

Airtable is available in Page Generator Pro 3.3.5, releasing Thursday 28th July 2021.

When Source is set as RSS Feed, the following option are displayed when adding or editing a Keyword on the Keyword form:
Page Generator Pro: Keywords: Source: RSS Feed

  • RSS Feed: The direct URL to the RSS feed.
    • This must be a publicly accessible RSS Feed
The RSS Feed URL must remain publicly accessible for Generate Content and Generate Terms functionality to work with this Keyword.

Adding / Editing Keywords: Saving

When you’re finished, click the Save button.  A notification will be displayed confirming that the Keyword saved successfully.
Page Generator Pro: Keywords: Success Notification

If you try to create / change a keyword to one that already exists, you’ll receive a warning telling you that the keyword has already been specified. Each keyword must be unique.

Adding / Editing Keywords: Viewing Terms

Once a Keyword has been added, its Terms can be viewed in one of two ways:

  • When Source is Local, the Terms can be edited in the form field:
    Page Generator Pro: Edit Keyword: Terms Form
  • When Source is not Local, Terms are displayed in a paginated, searchable table:
    Page Generator Pro: Edit Keyword: Terms Table

Support for Multiple Lines

When adding or editing content to a Keyword that spans multiple lines for a single Term, you’ll need to use HTML.

Let’s assume that you have the following example Keyword configured (colors used to denote two Terms for illustrative purposes only):

Setting Value
Keyword description
Terms I am the first description across
two lines.
I am the second description across
two lines.

You would define the Terms as follows:

Setting Value
Keyword description
Terms I am the first description across<br />two lines.
I am the second description across<br />two lines.

Understanding Delimiter and Columns

When adding or editing a Keyword, you’ll see options on the Keywords form to optionally define a Delimiter (and, if the source is local, Columns).

When specified, these provide greater control over which part of a Term to output when using the Keyword in our content.

Let’s assume that you have the following example Keyword configured:

Setting Value
Keyword location
Terms Birmingham, West Midlands
Harborne, West Midlands
Selly Oak, West Midlands

We can define the Delimiter and Columns as:

  • Delimiter: , (comma)
  • Columns: city_name,county_name

This means that we could use the Keyword, with a Column Name, in our Content Groups to output a partial Term value:

Keyword Example Value
{location(city_name)} Birmingham
{location(county_name)} West Midlands
The pipe symbol is not supported in the delimiter field.
There should be no spaces in the columns field.
Regardless of the character used in the delimiter field, columns in the columns field must be separated by a comma.

Using the Delimiter Character within Terms

It’s highly recommended to set a Keyword’s Source as CSV File / CSV URL, or use the Import CSV functionality. This will automatically handle encapsulation of the delimiter character.

Let’s assume that you have the following example Keyword configured:

Setting Value
Keyword location
Terms Birmingham, West Midlands, 100,000
Harborne, West Midlands, 10,000
Selly Oak, West Midlands, 20,000

We can define the Delimiter and Columns as:

  • Delimiter: , (comma)
  • Columns: city_name,county_name,population

Saving this Keyword would result in the following error:
The number of column names detected does not match the number of deliniated items in the first term.

This is because the Delimiter (comma) is used for formatting the Population numbers (e.g. 100,000).

We can tell the Plugin to ignore the Population delimiter by wrapping the Population data in quotes:

Setting Value
Keyword location
Terms
Birmingham, West Midlands, "100,000"
Harborne, West Midlands, "10,000"
Selly Oak, West Midlands, "20,000"
Page Generator Pro will automatically strip the quotes from the output when {location(population)} is used.

Using Quotation Marks within Delineated Terms

It’s highly recommended to set a Keyword’s Source as CSV File / CSV URL, or use the Import CSV functionality. This will automatically handle quotation marks within cells.

Let’s assume that you have the following example Keyword configured:

Setting Value
Keyword location
Terms “Birmingham, West Midlands”,”<h2 class=”title”>Birmingham, West Midlands</h2>”
“Harborne, West Midlands”,”<h2 class=”title”>Harborne, West Midlands</h2>”
“Selly Oak, West Midlands”,”<h2 class=”title”>Selly Oak, West Midlands</h2>”

Again, we can define the Delimiter and Columns as:

  • Delimiter: , (comma)
  • Columns: city,html

We’re using quotation marks around our Terms (for example, “Birmingham, West Midlands), so that the comma delimiter is preserved as covered in the Using the Delimiter Character within Terms section above.

However, using the {location(html)} Keyword will wrongly result in <h2>Birmingham being output, instead of <h2>Birmingham, West Midlands</h2>, because we’re also using quotation marks within a delineated Term.

By escaping these quotation marks with a backslash (\), the Term(s) are fully preserved and therefore output correctly:

Setting Value
Keyword location
Terms “Birmingham, West Midlands”,”<h2 class=\“title\“>Birmingham, West Midlands</h2>”
“Harborne, West Midlands”,”<h2 class=\“title\“>Harborne, West Midlands</h2>”
“Selly Oak, West Midlands”,”<h2 class=\“title\“>Selly Oak, West Midlands</h2>”
Page Generator Pro will automatically strip the backslash escaping from the quotation marks for the output when {location(html)} is used.

Search Keywords

To search existing Keywords, enter part or all of the Keyword Name in the search box:
Page Generator Pro: Keywords: Search

Click the Search button to see matching results.

Sort Keywords

To sort existing Keywords, click the Keyword column.  Repeating this will sort the Keywords in the opposite order.

Define Table Columns to Display

By default, all Keyword attributes are displayed on screen:
Page Generator Pro: Keywords: Table Columns

You can adjust which columns of data to display by:

  • Clicking the Screen Options tab at the top right of the screen:
    Page Generator Pro: Keywords: Screen Options
  • Check or uncheck the relevant columns to display/hide:
    Page Generator Pro: Keywords: Screen Options: Table Columns
  • Click the Apply button

Define Number of Keywords Per Page

By default, up to 20 Keywords are displayed on screen before pagination is then output, allowing you to paginate through your Keywords:
Page Generator Pro: Keywords: Pagination

You can adjust the number of Keywords per Page by:

  • Clicking the Screen Options tab at the top right of the screen:
    Page Generator Pro: Keywords: Screen Options
  • Enter the number of Keywords to display per Page:
    Page Generator Pro: Keywords: Screen Options: Pagination
  • Click the Apply button
This setting is stored on a per-User basis, and therefore only affects the current logged in User.   

Duplicate a Keyword

To duplicate an existing Keyword:

  1. Hover the mouse cursor over the Keyword that you want to duplicate.
  2. Click on the Duplicate link which then appears below the Keyword
    Page Generator Pro: Keywords: Duplicate

The Keyword will then appear within your list of Keywords, with _copy appended to it:
Page Generator Pro: Keywords: Duplication Result

If you try to change a keyword to one that already exists, you’ll receive a warning telling you that the keyword has already been specified. Each keyword must be unique.

Export a Keyword to CSV

To export an existing Keyword to CSV

  1. Hover the mouse cursor over the Keyword that you want to duplicate.
  2. Click on the Export to CSV link which then appears below the Keyword
    Page Generator Pro: Keywords: Export CSV

A CSV file will then be downloaded by your web browser, named as the Keyword

Page Generator Pro: Keywords: Export CSV Download

This option is useful if you need to mass edit Term(s) in a Keyword. Once done, you can import the Keyword CSV file.

Delete a Keyword

To delete a Keyword, either:

  • Use the checkboxes to the left of the keyword(s) you wish to delete, and then choose Delete from the Bulk Actions dropdown
    Page Generator Pro: Keywords: Bulk Delete
  • Hover the mouse cursor over the keyword, and then click the Delete link:
    Page Generator Pro: Keywords: Delete
Once a Keyword is deleted, it cannot be restored.  Any Content Groups that use this Keyword will need to also be updated.