Internal links between generated pages
3 min read
Thousands of pages that nothing links to are hard for search engines to find. Internal links let every generated page point to related pages (the same city, the same category) and let a hub page list a whole task. They are printed by the Generated Page Links block or the [wpmcf_pseo_links] shortcode; both print the same list.
The shortcode
[wpmcf_pseo_links task="12" match="country" limit="5" heading="More cities in this country"]Attribute | Default | Meaning |
|---|---|---|
| – (required) | The ID of the task whose pages are listed. Without it nothing is printed. |
| none | Up to 3 column names, comma-separated. Only pages whose row has the same value in these columns as the page being viewed are listed. |
|
| Number of links, 1 to 50 |
|
|
|
|
| Leave out the page itself |
| none | A heading printed above the links (also the accessible label of the list) |
|
|
|
The task ID is shown in the task's address in the admin (#tasks/12).
Example output (style="list"):
<nav class="wpmcf-pseo-links" aria-label="Other cities">
<h2 class="wpmcf-pseo-links__heading">Other cities</h2>
<ul class="wpmcf-pseo-links__list">
<li><a href="https://example.com/guides/porto/">Visit Porto</a></li>
<li><a href="https://example.com/guides/zurich/">Visit Zürich</a></li>
</ul>
</nav>With style="inline" the list is <p class="wpmcf-pseo-links__inline"> with links separated by · . Without a heading the label is "Related pages".
The block
In the block editor (or in the template, in a block theme) add Generated Page Links (category Widgets; search "links", "related" or "internal links"). The sidebar group Links has:
Control | Attribute |
|---|---|
Pages of task (“— Select —”; “No Programmatic SEO tasks yet.” when there are none) |
|
Only pages with the same value as this page in (choose columns) |
|
Order: By title, Recently changed first, Mixed (stable per page) |
|
Number of links |
|
Leave out the page itself |
|
Heading |
|
Style: List, One line |
|
In the editor an unconfigured block says "Choose a task in the block settings." The block supports margin, padding and font size.
Where to put it
Place | Effect |
|---|---|
In the template | Every generated page links to its neighbours. Use |
On a normal hub page (for example "All city guides") | Lists the pages of the task. |
What is listed
- Only live and indexable pages of that task (hidden, removed, shadowed and noindex pages are never linked).
- Pages in the same language as the current page (Business multilingual tasks).
- The
matchcolumns must belong to the first data source of the task. If the current page has no value for a column (empty cell), nothing matches and nothing is printed; the same happens when no other page shares the value. In the test withmatch="country"and a single French row, the list was empty and printed nothing. randomorder is stable per page: the same page always shows the same links, so crawlers see no flicker.- The title of each link is the page's title; the URL is the language-aware generated URL.
An empty list prints nothing (no empty heading). If the feature is not available on the current plan (for example after a license ended) nothing is printed either.
Caching and speed
Lists are cached for up to an hour per page and query and are rebuilt whenever generated pages change (runs, edits, conversions). A list costs one indexed query on a cache miss. Shortcodes in templates are safe to use on thousands of pages.
Tips
- Link up (a city page to its country hub) and sideways (same country), not to all pages: 10 to 20 links per page is plenty.
- Use
order="random"orrecentto spread links over all pages; usetitlefor hub pages. - Combine with breadcrumbs (SEO plugins and meta): the parent path segments become links when they are pages.
Still stuck? Contact support