Wiki Links & Interlinks
Wiki links are the backbone of a knowledge base. WB Member Wiki uses MediaWiki-style double-bracket syntax to create links between wiki pages, automatically building a web of interconnected content.
Syntax
Section titled “Syntax”Basic Link
Section titled “Basic Link”The [[Industrial Revolution]] transformed manufacturing.Links to the wiki page titled “Industrial Revolution”. The matching is case-insensitive.
Custom Display Text
Section titled “Custom Display Text”The [[Industrial Revolution|rise of industry]] changed everything.Displays “rise of industry” as the link text, linking to the “Industrial Revolution” page.
How Links Resolve
Section titled “How Links Resolve”When a wiki page is displayed, the plugin scans the content for all [[...]] patterns and resolves them in a single batch query for performance:
- All referenced page titles are collected
- A single database query fetches matching wiki pages
- Each link is replaced with the appropriate HTML
Link States
Section titled “Link States”| State | Appearance | Behavior |
|---|---|---|
| Existing page | Standard blue hyperlink | Links directly to the wiki page |
| Missing page | Styled differently (red/special class) | Indicates the page can be created |
Backlinks
Section titled “Backlinks”Every wiki page automatically tracks which other pages link to it. This creates a bidirectional linking system:
- Outgoing links - Pages this page links to via
[[...]]syntax - Backlinks - Pages that link to this page
When you save a wiki page, the plugin:
- Extracts all
[[...]]wiki links from the content - Resolves each link to a page ID
- Stores individual
_wbmw_links_tometa entries for each target page - This index enables fast backlink lookups without content scanning
Viewing Backlinks
Section titled “Viewing Backlinks”Backlinks are displayed on the wiki page, showing up to 50 pages that link to the current page. This helps users discover related content and understand how topics connect.
Performance
Section titled “Performance”The interlinking system is optimized for large wikis:
- Batch resolution - All wiki links on a page are resolved in a single database query
- Post meta index - Backlinks use indexed meta queries (
_wbmw_links_to) instead of slowLIKEcontent searches - Result caching - Page lookups are cached per request to avoid redundant queries
Best Practices
Section titled “Best Practices”When to Use Wiki Links
Section titled “When to Use Wiki Links”- Reference related concepts that have their own wiki pages
- Link to prerequisite or follow-up topics
- Connect parent topics to child topics and vice versa
Tips for Effective Linking
Section titled “Tips for Effective Linking”- Link on first mention - Add the wiki link the first time a concept appears in your page, not every occurrence
- Use natural language - Write links that flow naturally in sentences
- Create before linking - Consider creating stub pages for important topics, then expand them later
- Check for typos - Links resolve by exact title match, so “Quantam Computing” won’t link to “Quantum Computing”
Avoid Over-Linking
Section titled “Avoid Over-Linking”Not every noun needs a wiki link. Link to pages that provide genuinely useful additional context. A page with too many links becomes hard to read.
Developer: Link Processing
Section titled “Developer: Link Processing”Wiki links are processed via the the_content filter at priority 5, running before most other content filters:
// The interlinking class handles parsing$interlinking = new WBMW_Interlinking();add_filter( 'the_content', array( $interlinking, 'parse_wiki_links' ), 5 );The generated HTML uses these CSS classes:
| Class | Element |
|---|---|
.wbmw-wiki-link |
Existing page link |
.wbmw-wiki-link-new |
Missing page link |

