MediaWiki is a great Open Source platform written in PHP to build your very own Wiki site. MediaWiki was developed by Wikimedia Foundation to run Wikipedia, Wikitionary, and other associated projects. It was launched in 2002 to the public and is widely supported by the Open Source community developers. Today, MediaWiki is supported with over 2,000 extensions. It is available in 300 languages with avid following on its official forums from around the world.
MediaWiki itself is a very powerful CMS with many great features. However, the biggest weakness of MediaWiki is that it is not optimized for search engines, and to rank a regular Wiki site you will have to take major steps to bring organic search traffic to your Wiki site.
It is a sad thing that no one seems to work hard on its SEO practices on MediaWiki websites. Fine, I do understand it is not a bed of roses, but with a little amount of tinkering here and there, you can make it search friendly.
Tip 1: Create Robots.txt
Robots.txt is a file that lets webmasters define which pages of their websites should (or should not) be crawled by the search engines robots (also known as web robots, crawlers, spiders, or bots). Whenever a search engine bot (for e.g. Googlebot) visits the website, it first checks for the file
robots.txt and then it follows the instructions written in the file.
For a MediaWiki based website, it is best to disallow the indexing of admin and non-article pages that are created dynamically to avoid duplicated pages to be indexed by bots.
robots.txt file and paste these commands in the file for a MediaWiki site. Then, upload this file in the root folder of your MediaWiki website.
123456789 User-agent: *Disallow: /index.php?diff=Disallow: /index.php?oldid=Disallow: /index.php?title=HelpDisallow: /index.php?title=ImageDisallow: /index.php?title=MediaWikiDisallow: /index.php?title=Special:Disallow: /index.php?title=TemplateDisallow: /skins/
You can find more information at https://www.mediawiki.org/wiki/Manual:Robots.txt
Tip 2: Generate Sitemap.xml
sitemap.xml is a file that contains all the URLs of a website that are allowed for crawling. It is usually a good practice to generate
sitemap.xml file on a monthly basis (or on a weekly basis if new pages and content are added frequently to your Wiki).
sitemap.xml can be generated through many online free sitemap generators like http://www.xml-sitemaps.com/ or http://www.web-site-map.com/. Then upload the generated
sitemap.xml file to the root folder of your website. Once uploaded, you should submit it into the Google and Bing Webmaster Tools.
Tip 3: Set page titles
Best practice for visibility in the SERPs is to set title tags with the best key phrase that explains what your page is about. Editing the title tags of a website built on MediaWiki is not easy; therefore, we recommend using the CustomTitle extension. Follow these instructions for successful integration: https://www.mediawiki.org/wiki/Extension:CustomTitle
Tip 4: Set internal links
Linking relevant pages to each other with targeted key phrases also improves your website’s SEO quality. You should manually add internal links to other pages of your MediaWiki website. It lets readers discover more pages on your website and also improves the crawling chances of internal linked pages.
Tip 5: Rewrite URLs
By default, MediaWiki website URLs are not search engine friendly and it is hard for your visitors to remember pages by URLs. It is advisable to rewrite the URLs of your MediaWiki website with methods written at the following link: https://www.mediawiki.org/wiki/Manual:Short_URL
Tip 6: Verify Google+ page
Google+, the social network from Google, has many advantages if used properly to drive traffic to your website. It is advisable to setup a Google+ page for your MediaWiki website and verify your website through Google Webmaster Tools. A verified page becomes the official Google+ Page representing your website.
Tip 7: Set ALT text On all images (Image Optimization)
By default in MediaWiki websites, alt text are picked up from the caption field. So, the best practice is to choose proper keywords for your caption field. Follow detailed instructions from here: https://www.mediawiki.org/wiki/Help:Images
Tip 8: Install webmaster tools from Google and Bing
Google and Bing Webmaster Tools provide useful information about site-related issues. Through these tools, experienced webmasters can identify new opportunities to optimize their websites. The easiest way to install Google Webmaster Tools is to upload HTML verification file to the root folder and similarly uploading verification XML file (generated by Bing) to verify Bing Webmaster Tool.
Tip 9: Install Google Analytics (GA)
Google Analytics provides useful information about your site’s visitors and their behavior. Setting GA is highly recommended as it generates useful reports about how many people are visiting your website and from which source they are coming from. There are multiple ways to setup GA, but most easy method is to use this extension: https://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration
BONUS TIP: Use Cloudways Click&Go
Page load time speed has also become a major ranking factor. Search engines tend to favor those websites in SERPs that have very low response times. For blazing fast load times, Cloudways has developed Click&Go that is fully optimized for MediaWiki websites. It just takes a single click to launch your MediaWiki website hosted on the cloud.
Create PHP websites without the worry of server management.
Deploy your PHP app on optimized PHP hosting servers.