Search Engine Optimization (SEO) MODX Revolution - Build your online business

Friday, September 13, 2019

Search Engine Optimization (SEO) MODX Revolution

MODX is considered one of the most SEO-oriented CMS, consider a few simple steps that will help search engines to appreciate your site.

Configure robots.txt and .htaccess
The most important parameter for SEO, for more details on the robots.txt and .htaccess settings, see here - robots.txt and .htaccess in MODX Revo. By the way, at the time of development of the site - it is better to close it from indexing in robots.txt and open it only after everything is configured and filled.

Setting (SEF)
For more information about setting up the SEF links, see here - Setting up the CNC (SEF) in MODX Revolution.

404 error
Create a 404 page in the resource tree.


Then we specify the ID (the number in the resource tree of the control panel in brackets next to the page title) of our 404 pages in the system settings, for this, we go to the top menu of the admin panel "System Settings -> Site".





Unique meta tags: title, description, keywords
Meta tags are also an extremely important parameter for search engines, and you need to make them unique and reflect the theme of the page for each page.

There is a good component that creates additional fields for meta tags in the admin panel, with a check for the entry of keywords - SEO Pro. It also shows how the page will be displayed in the search engine (you can select the one you need in the component settings).






<base href="[[!++site_url]]">
<meta charset="[[++modx_charset]]">
<title>[[*longtitle:notags:default=`[[*pagetitle:notags]]`]] | [[++site_name]]</title>
<meta name="description" content="[[*description:notags:default=`[[++site_name]] | [[*longtitle:notags:default=`[[*pagetitle:notags]]`]]`]]">
<meta name="keywords" content="[[+seoPro.keywords:notags:default=`[[*pagetitle:notags]] [[++site_name]]`]]">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="canonical" href="[[~[[*id]]? &scheme=`full`]]">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="/assets/tpl/css/style.css">


I also use the I / O modifier: default, this allows me to generate meta tags, if they were not filled out, from the required fields (in my case [[* pagetitle]] and [[++ site_name]]); more about modifiers see here - I / O filters (modifiers).

Setting sitemap.xml
After all the pages are full, you can create a sitemap for the search engines (sitemap.xml), see more about this here - How to create a sitemap.xml file in MODX Revo.

How to remove .html in url
Sometimes it is necessary to replace the .html extension with / (slash) at the url on the site (or delete .html altogether), for example, replace all links of the form "contacts.html" with "contacts /".

to do this, go to the top menu of the admin panel "Content -> Content Types", find "HTML" there and change it to / (or delete) its "File Extension".




Correctly specify links to resources
Very often, developers or content managers specify links to other resources through sef aliases, for example like this:
<a href="/kontakti.html"> go to the contacts section </a> however this is not true, because the resource alias (in this case, "kontakti") can be further changed, for example, to "contacts" and the link to contacts, accordingly, will stop working.

It is correct to specify links to other resources through the resource ID, i.e. regardless of the page alias - the page will open:
<a href="[[~10]] go to the contacts section </a>, where 10 is the ID of the contact page.

If you need a website for your business on MODX CMS , feel free to contact me


No comments: