Note
This extension is unmaintained as of the 23rd of June, 2026. Consider using an alternative instead, such as utdrwiki/discussions.
Some parts of the implementation were inspired by the utdrwiki/discussion extension.
This extension is in BETA. It has been tested on MediaWiki 1.46 and Discourse Latest. Best results on Citizen, Vector22 tested and working.
Replaces the Discussion/Talk Page button with a link to your Discourse forum and adds up to 3 related posts from your Discourse forum to the bottom of the page like the RelatedArticles extension. Currently only available in English. This extension does not act as a bridge between MediaWiki SSO and Discourse SSO. Depending on your Discourse instance's configuration, you may be able to use dummy variables for the API key and username.
- MediaWiki 1.43.0+ (1.46 verified)
- Discourse Latest
- Citizen skin (recommended)
- RelatedArticles extension (recommended) (extension not tested without RelatedArticles, use for best stability)
- Have a working Discourse instance set up with admin access
- Download and place the extension in your
mediawiki/extensionsdirectory - Run
sudo chmod -R 755 extensions/DiscourseIntegrationif necessary - Add
wfLoadExtension( 'DiscourseIntegration' );to yourLocalSettings.php - Add the required configuration options to your
LocalSettings.php, see Config Reference below
$wgDiscourseReplaceTalkPagesREQUIRED - defaultTRUE- Whether to replace Talk Page links with links to Discourse search (e.g., https://discourse.example.com/search?q=Page+Title)$wgDiscourseBaseURLREQUIRED - default"https://discourse.example.com"- Base URL of the Discourse instance. Do not include trailing slash.$wgDiscourseAPIKeyREQUIRED - default""- API key for the Discourse instance. Must be global with read/write permissions.$wgDiscourseAPIUsernameREQUIRED - default"system"- Username used to process all API requests.$wgDiscourseTargetNamespacesBEST PRACTICE - default[0]- Namespaces to replace talk page buttons with Discourse threads and show related posts.$wgDiscourseTargetSkinsBEST PRACTICE - default["citizen","vector","vector-2022"]- Skins (in lowercase) to replace talk page buttons with Discourse threads and show related posts.$wgDiscourseExcludeStrings- default[]- List of strings. If a page title contains any of these, the talk page link will NOT be replaced.$wgDiscourseExcludePages- default["Main_Page", "Home", "Main", "Mainpage"]- List of page titles. If a page title matches any of these, the talk page link will NOT be replaced and related posts will not be shown.$wgDiscourseSquarePFPsForAll- defaultFALSE- Use square profile pictures instead of rounded.$wgDiscourseSquarePFPsForUsersWithTitles- default[]- Use square profile pictures instead of rounded for users with certain titles.$wgDiscourseUseNoFollowOnForumLinks- defaultFALSE- Add nofollow to all links to the forum. Not recommended for SEO.$wgDiscourseOpenForumLinksInNewTab- defaultTRUE- Open all links to the forum in a new tab using_blank, otherwise uses the default behavior of the browser.$wgDiscourseCacheTTL- default3600- How long (in seconds) to cache Discourse API responses. Failed API calls are cached for 5 minutes to avoid hammering Discourse.$wgDiscourseTopicSortOrder- default""- Sort order for related topics. When empty, searches by relevance. Accepts values like"latest","likes","views".$wgDiscourseMaxRelatedPosts- default3- Maximum number of related posts to display.$wgDiscourseSiteName- default"Discourse"- Name of the forum to display on hover over related posts.$wgDiscourseShowRelatedPosts- defaultTRUE- Whether to show related posts at the bottom of the page.$wgDiscourseRootForumURLForNonMain- defaultFALSE- If true, non-main namespaces will link to the base forum URL instead of searching for the page title. If false, they will use the default talk pages.
- Image headers: Added support for images in posts
- Tidy up configuration: Simplified configuration options by removing
$wgDiscourseTalkNamespaces,$wgDiscoursePostsNamespaces,$wgDiscourseTalkSkins, and$wgDiscoursePostsSkinsand replacing them with$wgDiscourseRootForumURLForNonMain. - Fix: Fixed an issue where the talk page link was not replaced in non-target namespaces even with configurations.
- Fixed styles: Certain styles were not applied correctly. Also simplified styles into the dedicated css resource file. Also aligns and matches with the Related Articles extension better.
- Configuration separation: Added separate controls for talk page replacement and related posts via
$wgDiscourseTalkNamespaces,$wgDiscoursePostsNamespaces, etc. - Skin enhancement: The Discourse logo now replaces the talk icon on the Citizen skin for a more integrated feel.
- New Toggle: Added
$wgDiscourseShowRelatedPoststo explicitly enable/disable the related posts section independent of other features.
- Caching improvements: Configurable cache TTL via
$wgDiscourseCacheTTL, negative caching (failed API responses are cached for 5 minutes), and HTTP request timeouts - Bug fix:
DiscourseExcludePageswas missing fromCONSTRUCTOR_OPTIONSand could cause assertion failures - Proper hook handler DI:
RelatedPostsis now registered as aHookHandlerviaextension.jsonwith dependency injection instead of using a static bridge method - CSS refinement: All inline styles moved to
resources/styles.css— styles are now skin-overridable and browser-cacheable - Styles module loading: The
ext.DiscourseIntegration.stylesmodule is now actually loaded (was previously defined but never added to the page output) - Error logging: API failures are now logged via MediaWiki's logging framework (
DiscourseIntegrationchannel)
- Potentially delay paint until user scrolls to the bottom like RelatedArticles
- Ability to customize cache TTL by category and page size
- Support for solved posts