Overview
Your defined Keywords can be used in any editable text field or Page Builder on a Content Group or Term Group.
When generating content, Page Generator Pro will replace these keywords with actual terms specified in the keywords. For example, if our {service} keyword comprises of Web Design and Web Development, the Plugin would generate at least two Pages:
- Web Design in…
- Web Development in…
Depending on the field you’re editing, and the editor experience you’re using, you can add keywords to your content in a number of ways:
Insert Keyword Dropdown
The Insert Keyword dropdown option is displayed on some fields in the Classic Editor, such as the Title and Excerpt:
If you are not using the Classic Editor Plugin (i.e. you are using Gutenberg/the block editor, or a Page Builder), refer to the below sections, which cover using Keywords for those accordingly.
Autocomplete Suggestions
For most fields, an autocomplete dropdown list of matching Keywords will be displayed when you begin typing with a left curly brace.
Continue to type until you see the keyword you want to insert, and either:
- Click the keyword,
- Use the arrow keys on the keyboard to navigate up and down the autocomplete list, highlighting the required Keyword and pressing the Enter key
For example, to add a defined Keyword called service:
- Start typing {ser,
- Click the resulting keyword in the list:
To hide or cancel autocompletion, either press the escape key, or click outside of the list of suggested keywords.
Gutenberg Title and Blocks
An autocomplete dropdown list of matching Keywords will be displayed when you begin typing with a left curly brace.
Continue to type until you see the keyword you want to insert, and either:
- Click the keyword,
- Use the arrow keys on the keyboard to navigate up and down the autocomplete list, highlighting the required Keyword and pressing the Enter key
For example, to add a defined Keyword called service:
- Start typing {ser,
- Click the resulting keyword in the list:
To hide or cancel autocompletion, either press the escape key, or click outside of the list of suggested keywords.
Classic / Visual / TinyMCE Editor
An autocomplete dropdown list of matching Keywords will be displayed when you begin typing with a left curly brace.
Continue to type until you see the keyword you want to insert, and either:
- Click the keyword,
- Use the arrow keys on the keyboard to navigate up and down the autocomplete list, highlighting the required Keyword and pressing the Enter key
For example, to add a defined Keyword called service:
- Start typing {ser,
- Click the resulting keyword in the list:
To hide or cancel autocompletion, either press the escape key, or click outside of the list of suggested keywords.
Transforming Keywords
Assuming you have the following example Keyword configured:
Setting | Value |
---|---|
Keyword | location |
Terms | Birmingham, West Midlands Harborne, West Midlands Selly Oak, West Midlands |
Delimiter | , |
Columns | city, county |
The output of keyword terms can be transformed, by using a flag after the keyword. For example:
- {location:uppercase_all} would convert Birmingham, West Midlands to BIRMINGHAM, WEST MIDLANDS.
- {location(city):lowercase_all} would convert Birmingham to birmingham
Some Keyword Transformations also support arguments, which are defined in square brackets. For example:
- {location(city):random[2,4]} would choose between two and four Terms at random, outputting them in a random order as a comma separated list.
Multiple Transformations
Multiple transformations can be applied to a Keyword, and are applied in the order they are written, from left to right. For example:
Transformation | Syntax | Output |
---|---|---|
Uppercase and Convert to Permalink style slug | {location:uppercase_all:url} | birmingham-west-midlands |
Convert to Permalink style slug and Uppercase | {location:url:uppercase_all} | BIRMINGHAM-WEST-MIDLANDS |
The below sections detail the available Keyword Transformations.
Character Transformations
Transformation | Syntax | Output |
---|---|---|
Uppercase | {location:uppercase_all} | BIRMINGHAM, WEST MIDLANDS |
Lowercase | {location:lowercase_all} | birmingham, west midlands |
Capitalise first letter | {location:uppercase_first_character} | Birmingham, west midlands |
Capitalise first letter of each word | {location:uppercase_first_character_words} | Birmingham, West Midlands |
First word | {location:first_word} | Birmingham |
Last word | {location:last_word} | Midlands |
Convert to Permalink style slug | {location:url} | birmingham-west-midlands |
Convert to Permalink style slug, underscores | {location:url_underscore} | birmingham_west_midlands |
Permalink Transformations
Transformation | Syntax | Output |
---|---|---|
Convert to Permalink style slug | {location:url} | birmingham-west-midlands |
Convert to Permalink style slug, underscores | {location:url_underscore} | birmingham_west_midlands |
Force Keyword Term
The output of the keyword can be forced to always output a specific term. In the above example, this means that we could use the following keywords in our Content Group:
Transformation | Syntax | Output |
---|---|---|
Force Specific Term | {location:3} | Selly Oak, West Midlands |
Force Specific Term, City Column | {location(city):3} | Selly Oak |
Output All Terms
The output of the keyword can be forced to always output all terms, in a comma separated list. In the above example, this means that we could use the following keywords in our Content Group:
Transformation | Syntax | Output |
---|---|---|
Output All Terms | {location:all} | Birmingham, West Midlands, Harborne, West Midlands, Selly Oak, West Midlands |
Output All Terms, City Column | {location(city):all} | Birmingham, Harborne, Selly Oak |
Output Same Random Term
The output of the keyword can be set to output the same term, chosen at random. In the above example, this means that we could use the following keywords in our Content Group:
Transformation | Syntax | Output |
---|---|---|
Output Random Term | {location:random} | Selly Oak, West Midlands |
Output Random Term, City Column | {location(city):random} | Birmingham |
Output Same Random Terms in a List
The output of the keyword can be set to output the same list of terms, chosen at random, in a comma separated format, based on the arguments provided in square brackets. In the above example, this means that we could use the following keywords in our Content Group:
Transformation | Syntax | Output |
---|---|---|
Output 2 x Random Terms, City Column | {location(city):random[2]} | Selly Oak, Birmingham |
Output Different Random Term
The output of the keyword can be set to output a different term, chosen at random for each occurrence of the Keyword. In the above example, this means that we could use the following keywords in our Content Group:
Transformation | Syntax | Output |
---|---|---|
Output Random Term | {location:random_different} | Selly Oak, West Midlands |
Output Random Term, City Column | {location(city):random_different} | Birmingham |
Output Random Term Subsets in a List
Assuming you have the following example Keyword configured:
Setting | Value |
---|---|
Keyword | location |
Terms | Birmingham,West Midlands,”Granville Street,New Street,Lombard Street,Hagley Road,Bristol Road,Milner Road” Edgbaston,West Midlands,”Woodbourne Road, Augusta Road, Farquar Road,Edgbaston Street,Ryland Road” |
Delimiter | , |
Columns | city_name,region,street_names |
Instead of using {location(street_names)} to output the list of Street Names, we can use the Random Term Subsets transformation to output a subset of the Street Names, in a random order, based on the supplied comma separated list of arguments provided in square brackets:
Argument | Description | Example |
---|---|---|
Minimum Number of Term Subsets | The minimum number of Term Subsets to output | 2 |
Maximum Number of Term Subsets | The maximum number of Term Subsets to output | 4 |
In the above example, this means that we could use the following keywords in our Content Group, producing the Output based on the first term, Birmingham:
Transformation | Syntax | Output |
---|---|---|
Output between 2 and 4 Street Names | {location(street_names):random_subset[2,4]} | Hagley Road, New Street |
Output 3 Street Names | {location(street_names):random_subset[3]} | Bristol Road, Milner Road, New Street |
Output Nearby Terms in a List
Assuming you have the following example Keyword configured:
Setting | Value |
---|---|
Keyword | location |
Terms | Birmingham, 52.480000, -1.902500, West Midlands Harborne, 52.459999, -1.950000, West Midlands Selly Oak, 52.438660, -1.941110, West Midlands |
Delimiter | , |
Columns | city_name, city_latitude, city_longitude, county_name |
When using a Keyword, comprising of location names, latitudes and longitudes, the output of the Keyword can be set to list nearby locations in a comma separated list, based on the supplied comma separated list of arguments provided in square brackets:
Argument | Description | Example |
---|---|---|
Latitude Column Name | The name of the column holding the latitude for the given Keyword that is being transformed. | city_latitude |
Longitude Column Name | The name of the column holding the longitude for the given Keyword that is being transformed. | city_longitude |
Radius | The number of miles to restrict results to, based on the current Term | 3 |
Order Terms By Distance | Whether to order the output of Terms by distance | 1: Order by Distance 0: No order |
In the above example, this means that we could use the following keywords in our Content Group, producing the Output based on the first term, Birmingham:
Transformation | Syntax | Output |
---|---|---|
Output Nearby City Names within a 5 mile Radius, ordered by Distance | {location(city_name):nearby[city_latitude,city_longitude,5,1]} | Harborne, Selly Oak |
Output Nearby City Names within a 3 mile Radius, no ordering | {location(city_name):nearby[city_latitude,city_longitude,3]} | Harborne * Here, ‘Selly Oak’ is 3.2 miles from Birmingham, and therefore is not output. |
Number to Words Transformations
Assuming you have the following example Keyword configured:
Setting | Value |
---|---|
Keyword | number |
Terms | 1 2 3 |
Unless an argument is specified, output will be attempted in the WordPress Site’s Language.
Transformation | Syntax | Output |
---|---|---|
Convert Number to Word (English) | {number:number_to_words} | one |
Convert Number to Word in Brazilian Portuguese | {number:number_to_words[pt_BR]} | um |
Transformations can also be applied to a Keyword’s Column; in this case, the numeric column name:
Setting | Value |
---|---|
Keyword | number |
Terms | 1, one item 2, two items 3, three items |
Delimiter | , |
Columns | numeric, text |
Unless an argument is specified, output will be attempted in the WordPress Site’s Language.
Transformation | Syntax | Output |
---|---|---|
Convert Number to Word (English) | {number(numeric):number_to_words} | one |
Convert Number to Word in Brazilian Portuguese | {number(numeric):number_to_words[pt_BR]} | um |
Currency to Words Transformations
Assuming you have the following example Keyword configured:
Setting | Value |
---|---|
Keyword | price |
Terms | 3.99 2.50 1 |
Unless an argument is specified, output will be attempted in the WordPress Site’s Language, US Dollars.
Transformation | Syntax | Output |
---|---|---|
Convert Currency to Words (English, US Dollars) | {price:currency_to_words} | three dollars ninety-nine cents |
Convert Currency to Words in Brazilian Portuguese (US Dollars) | {price:currency_to_words[pt_BR]} | três dólares e noventa e nove centavos |
Convert Currency to Words in Brazilian Portuguese in Brazilian Real Currency | {price:currency_to_words[pt_BR,BRL]} | três reais e noventa e nove centavos |
Transformations can also be applied to a Keyword’s Column; in this case, the numeric column name:
Setting | Value |
---|---|
Keyword | price |
Terms | 3.99, “item costs 3.99” 2.50, “item costs 2.50” 1, “item costs 1.00” |
Delimiter | , |
Columns | numeric, text |
Unless an argument is specified, output will be attempted in the WordPress Site’s Language.
Transformation | Syntax | Output |
---|---|---|
Convert Currency to Words (English, US Dollars) | {price(numeric):currency_to_words} | three dollars ninety-nine cents |
Convert Currency to Words in Brazilian Portuguese (US Dollars) | {price(numeric):currency_to_words[pt_BR]} | três dólares e noventa e nove centavos |
Convert Currency to Words in Brazilian Portuguese in Brazilian Real Currency | {price(numeric):currency_to_words[pt_BR,BRL]} | três reais e noventa e nove centavos |
Combining Column Names, Transformations and Forcing Term
Any combination of the above Using Keywords sections can be used. For example:
Transformation | Syntax | Output |
---|---|---|
Output City Name, Uppercase | {location(city):uppercase_all} | BIRMINGHAM |
Output 3rd City Name, Lowercase | {location(city):3:lowercase_all} | selly oak |
Using Taxonomy Keywords in Groups
Any Taxonomy can also be used as a Keyword, by inserting the {taxonomy_name} tag into your content (where name is replaced by the name of your Taxonomy). For example, if you have Categories defined on your WordPress web site (typically found at Posts > Categories), you’d use :
You can insert Taxonomy Keywords manually into any content-based text field, even if the Insert Keyword dropdown isn’t present. For example:
- Title
- Permalink
- Content
- Excerpt
- Custom Fields
- Meta Key
- Meta Value
Common Issues
URLs stored in Keyword lose colon on Generation
Specifying a Keyword as the link source in Gutenberg will result in Gutenberg attempting to perform validation on the Keyword. This results in:
- Gutenberg prepending this automatically when it believes the string provided isn’t a URL (i.e. a Keyword),
- The link in the generated Page will be missing a colon.
It’s therefore recommended to either:
- Remove
http(s)://
from links in your Keyword, or - Use the Classic Editor block for that specific content section