Generate: Shortcodes: Wikipedia Content

Overview

The Wikipedia shortcode inserts text from Wikipedia about a given term (topic).

It can be used anywhere on a Content Group where shortcodes are processed, including Page Builders.

Visual Editor

To add Wikipedia Content when in a TinyMCE Visual Editor, click the Wikipedia icon in the Visual Editor toolbar:
Page Generator Pro: Generate: Shortcodes: TinyMCE Toolbar Button

A modal dialog window will display, where you can complete the following fields:
Page Generator Pro: Generate: Shortcodes: Wikipedia: Modal

Term(s)

Specify one or more Terms to search Wikipedia, to see if a matching article exists.

Keywords are supported in the Term(s) field.

Where multiple Terms are specified, searching is performed in the order of the Terms.  Once a matching article is found for a Term, searching stops.  Therefore, it’s recommended that you specify the most exact Term first, through to the least exact Term last (which acts as a fallback should no content be found for more precise Terms).

Specifying multiple Terms does not mean that content is collated from multiple articles.

To add a Term:

  • Start typing in the Term(s) field
  • Either click the ‘Add’ option which appears below the field, or press the Enter key
    Page Generator Pro: Generate: Shortcodes: Wikipedia: Add Term
  • Repeat for any additional Term(s) that you may wish to search for on Wikipedia

To re-order Terms (which determines the search order):

  • Drag and drop a Term to the left or right as necessary

To delete a Term, either:

  • Use the keyboard arrow keys within the field to move the caret to the right of a Term, and press the backspace key to delete it, or
  • Click the cross icon to the right of an existing Term.

Sections

Optionally specify one or more specific sections of the Wikipedia article to fetch content from that might be found in Wikipedia’s Contents table for each article.

If no sections are defined, the “summary” (content before Wikipedia’s Contents table) will be used.

For example, if our Term is {city}, many Wikipedia City pages contain History, Geography and Demography:
Page Generator Pro: Shortcodes: Wikipedia: Sections

We could therefore enter History,Geography,Demography into the field.

Keywords are supported in the Section field.

Where multiple Sections are specified, they will be output in the order specified.

To add a Section:

  • Start typing in the Section field
  • Either click the ‘Add’ option which appears below the field, or press the Enter key
  • Repeat for any additional Sections that you may wish to fetch content from

To re-order Sections (which determines the output order):

  • Drag and drop a Section to the left or right as necessary

To delete a Section, either:

  • Use the keyboard arrow keys within the field to move the caret to the right of a Section, and press the backspace key to delete it, or
  • Click the cross icon to the right of an existing Section.

Use Similar Page

If enabled, a similar Wikipedia Article will be used where an ambiguous Term (or Term in a list of Terms) was specified, and Wikipedia provides alternate Articles when viewing said Term.

For example, using the Term Live Oak, California returns the following links, with https://en.wikipedia.org/wiki/Live_Oak,_California itself not containing any meaningful content:

Page Generator Pro: Generate: Wikipedia: Use Similar Page

With the Use Similar Page option enabled, Page Generator Pro will use the second link (the first being in red, meaning that it too has no content).

Max. Paragraphs

The maximum number of paragraphs to output after all defined sections have been fetched and combined.

This limit applies as a whole, not to individual sections.

Apply Synonyms

If enabled, common words from the Wikipedia content will be replaced by multiple synonyms (similar words) in spintax format.  The spintax is then automatically spun.

Language

The language of the content to return.

Click the Insert button when you’ve completed the fields.  A shortcode will then appear within the content, based on the values you’ve supplied:
[page-generator-pro-wikipedia term="{city}, UK" sections="summary,history,government" use_similar_page="1" paragraphs="5" apply_synonyms="1" language="en"]

Gutenberg and other Editors

To add Wikipedia Content to any non-Visual Editor instance (or Visual Editor instances that don’t include the Wikipedia button), you’ll need to manually enter the shortcode syntax yourself.

Parameter Accepted Value Supports Keywords? Description
term string Yes Wikipedia Article to display.
Multiple Terms must be separated by a semicolon ;
sections string Yes Sections to fetch Wikipedia Page content from, based on the Table of Contents.
Multiple Sections must be separated by a semicolon ;
use_similar_page 0 or 1 Yes Whether to fetch a related / similar page when Term(s) are ambiguous
max_paragraphs integer Yes The maximum number of paragraphs to output, based on the aggregate of all content fetched from the above sections.
apply_synonyms 0 or 1 Yes If enabled, common words from the Wikipedia content will be replaced by multiple synonyms (similar words) in spintax format.  The spintax is then automatically spun.
language string Yes Two character language code

Troubleshooting

Sometimes, the Wikipedia shortcode won’t return any content for given Term(s).  If you’d like to increase the chances of content being returned:

  1. Run generation in Test mode for the problematic Term.  If the Term is from a Keyword, either:
    1. Use the Resume Index to force the Test method to use the appropriate keyword,
    2. Use the Keyword Index to force the Keyword Index within the shortcode,
    3. Replace the Keyword with the Term itself within the shortcode
  2. Make a note of the verbose output from the Test draft Page:
    Page Generator Pro: Generate: Shortcodes: Wikipedia: Verbose Errors on Testing

Depending on the output above, refer to the below resolutions available:

Issue Resolution
The page you specified doesn’t exist Use a different Term, or specify multiple Terms that can act as a fallback.
No paragraphs could be found in the sections [Sections] Specify valid Sections, by inspecting the Table of Contents for the Wikipedia Article.  Include “summary” as a section, or don’t specify any sections to ensure some content can be found and returned.
The Term [Term] is ambiguous and could relate to one of several articles available on Wikipedia. Enable the Use Similar Page option, to allow the shortcode to use one of the similar articles.