| Summary | Allows you to import a sitemap, to map page titles automatically to forum links, similarly to how ‘Watched Words’ works. | |
| Repository Link | GitHub - multidimension-al/discourse-sitemap-autolink: Turn sitemaps into automatic links in discourse. · GitHub | |
| Install Guide | How to install plugins in Discourse |
Features
This is an alternative to using the ‘Watched Words’ feature. It allows you to take your external website’s sitemap and import it, assign the words to match automatically, and then link them up during the next rebake. Very similar to how Watched Words works, but it adds the step of ingesting sitemaps and extracting the keywords.
Good for technical forums with a separate Wiki section, for example, or a forum with an associated news or e-commerce store.
You take your Wiki sitemap:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://www.example.com/wiki/soldering-iron-maintenance</loc><lastmod>2026-07-02</lastmod></url>
<url><loc>https://www.example.com/wiki/mosfet-driver-board</loc><lastmod>2026-07-05</lastmod></url>
<url><loc>https://www.example.com/wiki/li-ion-battery-pack</loc><lastmod>2026-07-11</lastmod></url>
<url><loc>https://www.example.com/wiki/pcb-etching</loc><lastmod>2026-07-19</lastmod></url>
<url><loc>https://www.example.com/wiki/flux</loc><lastmod>2026-07-23</lastmod></url>
</urlset>
The plugin will download the sitemap, grab the title from the page, and then generate the words to match. Those would be autolinked the next time any posts with those words are baked, or the plugin will look for those posts and rebake just those automatically.
Fetched <title> |
Stored title |
|---|---|
| Soldering Iron Maintenance - Example Wiki | Soldering Iron Maintenance |
| MOSFET Driver Board - Example Wiki | MOSFET Driver Board |
| Li-Ion Battery Pack - Example Wiki | Li-Ion Battery Pack |
| PCB Etching - Example Wiki | PCB Etching |
| Flux - Example Wiki | Flux |
Each of the titles become the matching phrases, with safety gates.
| Stored title | Generated phrases | State |
|---|---|---|
| Soldering Iron Maintenance | soldering iron maintenance(s) | active |
| MOSFET Driver Board | mosfet driver board(s) | active |
| Li-Ion Battery Pack | li-ion battery pack(s) | active |
| PCB Etching | pcb etching(s) | active |
| Flux | flux, fluxes | pending review — short, single word |
Then any post with something matching the phrase will automatically link back to your site’s wiki, a maximum of 1 time per post.
So if I have a post that says:
I was reading the Soldering Iron Maintenance page and noticed a problem with what it said…
The word ‘Soldering Iron Maintenance’ will be linked to the page associated with it in the sitemap.
Configuration
Once installed, there are a lot of settings that can be configured as well as a dedicated Catalog page that shows your sitemaps being imported and the list of phrases that will be matched along with the URL.
Find your sitemap XML file that you plan on importing and ensure that you are able to connect to that server without limitations from your Discourse installation. Locate the common site prefix or postfix and set the Sitemap autolink title suffixes with the part of the field that you don’t want. An example might be “- Discourse Meta” if you were wanting it to not match that page title. You can also specify to skip certain common words that may appear commonly on your site. Most of the settings do not need to be enabled, but allow you to adjust the timing and delay, how much time is allowed to be spent checking the sitemap, and how much time to delay between each URL.
Once the URL has been imported, it saves the lastmod time and doesn’t check again unless the lastmod field changes. You can manually assign or delete matching phrases, and it will automatically ask you about single-word matches.
Settings
Linking
| Setting | Default | Purpose |
|---|---|---|
sitemap_autolink_enabled |
off | Master switch. |
sitemap_autolink_max_links_per_destination_per_post |
1 | Times each destination may be linked per post (first mentions win). 0 = unlimited. |
sitemap_autolink_max_links_per_post |
0 | Total automatic links per post. 0 = unlimited. |
sitemap_autolink_skip_quotes |
on | Never link inside quoted material. |
sitemap_autolink_include_private_messages |
off | Also link in personal messages. |
sitemap_autolink_excluded_categories |
– | Never link in these categories (subcategories included). |
sitemap_autolink_enabled_types |
– (all) | Restrict which content types may link. |
sitemap_autolink_type_priority |
manual |
Collision priority order, strongest first; unlisted types rank last. |
Catalog & phrases
| Setting | Default | Purpose |
|---|---|---|
sitemap_autolink_sources |
– | Sitemaps to ingest, one per entry: https://example.com/sitemap.xml,content_type. Indexes expand automatically. |
sitemap_autolink_manual_mappings |
– | Manual phrase,url,type rules. Relative URLs resolve against the forum. |
sitemap_autolink_min_phrase_length |
5 | Shorter generated phrases go to review. |
sitemap_autolink_min_phrase_words |
2 | Generated phrases with fewer words go to review (letter+digit model-number tokens exempt). |
sitemap_autolink_generate_plurals |
on | Also generate simple plural variants. |
sitemap_autolink_title_suffixes |
– | Boilerplate stripped from the end of fetched titles. An entry can’t contain the ` |
sitemap_autolink_excluded_url_patterns |
– | Never ingest matching sitemap URLs (substring or * wildcard, e.g. */checkout*). |
sitemap_autolink_excluded_terms |
– | Exact phrases that must never be auto-generated. Manual aliases override. |
Synchronization
| Setting | Default | Purpose |
|---|---|---|
sitemap_autolink_sync_enabled |
off | Run the daily sitemap→catalog job. |
sitemap_autolink_page_fetch_delay_ms |
500 | Politeness pause between title fetches (new/changed URLs only). |
sitemap_autolink_sync_time_budget_minutes |
30 | Max minutes per run; the run stops cleanly as Partial and the next run resumes the remaining work. |
sitemap_autolink_fetch_host_rewrites |
– | Fetch a public host via an internal target (see below). |
Rebaking
| Setting | Default | Purpose |
|---|---|---|
sitemap_autolink_auto_rebake_on_changes |
off | After a sync, rebake posts likely affected by phrase changes — one batched background job per sync. |
sitemap_autolink_auto_rebake_max_phrases |
50 | If one sync changes more phrases than this, skip the auto-rebake entirely (so an initial import never triggers a near-full-forum rebake). |
sitemap_autolink_auto_rebake_max_posts |
500 | Most posts one sync’s rebake wave may touch. |
sitemap_autolink_max_rebakes_per_job_run |
200 | Batch size per job run; larger waves continue in follow-up jobs a minute apart. |
Analytics
| Setting | Default | Purpose |
|---|---|---|
sitemap_autolink_analytics_enabled |
on | Send internal_auto_link_click events to Google Analytics via gtag or dataLayer when generated links are clicked. No-op if neither exists. |
I use this to help link my main website with my Discourse forum. So a topic in our Wiki or Shop can automatically generate a link.
If someone is talking about a particular product, as long as they mention a keyword you assign or the product name itself, the link will be automatically added at bake time.
Similarly, if you have a Wiki site, you can take the page titles of the Wiki and automatically link them. Let’s say you have a history site and someone mentions ‘The War of 1812’, which coincides with a Wiki article of the same name, it will automatically link.
Hope you enjoy!
