Extension Compatibility - OpenCart: 2.1.x.x, 2.3.x.x, 3.0.0.0, 3.0.0.2, 3.0.1.0, 3.0.1.1, 3.0.1.2, 3.0.2.0, 3.0.3.0, 3.0.3.1, 3.0.3.2, 3.0.3.3, 3.0.3.4, 3.0.3.5, 3.0.3.6, 3.0.3.7, 3.0.3.8, 3.0.3.9, 3.0.4.0, 4.0.1.1, 4.0.2.1, 4.0.2.2, 4.0.2.3
DeveloperOpenCart Development Partner- Professional support of the author
- Lifetime license
- The license key is provided automatically
- Free license key for test domain
- Extensions can be modified
- Periodic module updates
- Free technical support
XML Sitemap with hreflang tags for OpenCart
This extension generates the correct multilingual XML sitemap for OpenCart. Generation of XML Sitemap meets the requirements of search engines. The extension allows you to fully manage the creation of a sitemap: include or exclude site pages, products, categories, manufacturers, etc.
DEMO AdminDEMO Live
Login/password: demo/demo
For each entity, such as Products, Categories, Pages, you can set a priority value (priority tag), content refresh frequency (changefreq tag). Also, in the sitemap, you can display the date of the last change of the product (lastmod tag) and the product image (image tag).
There is a unique function for adding any custom links to the xml sitemap. You can add different links for different language versions of pages. For each link, you can separately specify the priority and frequency of crawling by robots.
The extension allows you to set your own hreflang language code. Acceptable formats: en, en-gb, en-us, en-au etc.
Also extension Multilingual Sitemap XML OpenCart can give you both a dynamically generated sitemap and a static XML file via direct link. When choosing a static site map, it is necessary to ensure that it is periodically updated. To do this, it is enough to run the update link in the browser or set the task to run in the CRON scheduler on the hosting.
Multilingual Sitemap sample
The module will also work on monolingual sites and will return a valid sitemap.xml
The module is compatible with the standard SEO URL and with SEO Pro. It is also compatible with our "Multilingual add-on for SEO PRO" and "SEO multilanguage/multiregion" (SEO CMS) and will generate an XML map with URL language prefixes and hreflang attributes that indicate to search engines that the links are related and are different language versions of the same page.
Valid and fast sitemap.xml for Google, Bing and other search engines.
Features of the module Multilingual Sitemap XML OpenCart
- managing the addition of pages to the sitemap;
- adding any links to the sitemap
- manual control of priority, changefreq, lastmod parameters;
- own hreflang for each language;
- default localization selection - x-default;
- dividing the sitemap into parts, index file;
- separate sitemaps for products, categories, manufacturers, blogs, pages;
- dividing the Sitemap with products into parts by n-products;
- ignoring pages with the noindex tag (for ocStore);
- choice of file generating method: dynamic or static XML
- fast data processing and generation, own optimized sql queries;
- support for multilingual links and URLs with language prefixes;
- protect access to the sitemap with a password;
- update static sitemap by CRON task;
- multi-store support.
Installation instructions:
- Upload the module in the admin panel in the "Extensions" : "Install".
- Go to the "Dashboard" section and update the template cache.
- Go to the "Extensions" : "Extensions" : "Feeds" and enable the module.
- Edit module. Enable the status of the module and adjust all its options to your needs and save the settings.
- To check multilingual sitemaps, it is convenient to use the free service https://technicalseo.com/tools/hreflang/
Also, you can use the Sitemap XML checker services from Google and Bing.
Screenshots of Multilingual Sitemap XML
FAQ: Multilingual Sitemap XML
How to set a CRON task to update the static sitemap.xml file?
Open the control panel of your hosting (ISP Manager, Cpanel, VestaCP, etc.), find the CRON section there and create a new task there.
If your hosting allows you to run scripts using the wget method, then you can simply copy the link from the module settings and paste it into the task.
But it happens that the hosting allows only the direct launch of scripts.
In this case, you need to create a script that will be run via CRON:
-
In the root of the site, create a new php file (for example, cron-sitemap.php).
-
Insert a script into it that will update the site map.
A variant of the script using the file_get_contents function:
<?php
// Paste your URL by copying it in the module
settings
$url = 'https://domain.com/index.php?route=extension/feed/sitemap_ml';
echo file_get_contents($url);
?>
A variant of the script using cURL:
<?php
// Paste your URL by copying it in the module
settings
$url = 'https://domain.com/index.php?route=extension/feed/sitemap_ml';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
?>
-
It is necessary to form an absolute path to our file, for example /home/user/public_html/domain.com/cron-sitemap.php
You can find out the path to the root folder of the site on the server in the file config.php
-
In the hosting control panel, go to the CRON section and create a new task there. This page should contain brief information on how to create a task.
Usually you need to choose the frequency of the script launch and write the command. The command must use the absolute path to the file we created.
Each hosting may have its own features of adding a cron task. If you have any problems at this stage, you can contact your hosting support for help.
How to make a link to a dynamic site map in the form of sitemap.xml?
In the .htaccess file, which is located at the root of the site, go to the line:
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
replace it with:
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/sitemap_ml [L]
You will then need to reset your browser's cache to see the changes.
If you are using SEO Pro to generate clear SEO URL, you need to make one more edit in the file catalog/controller/startup/seo_pro.php
You need to find the phrase "google_sitemap" there and replace it with "sitemap_ml". If there is no such phrase - you need to add the following code to the validate() method (as in the screenshot below).
if (ltrim($this->request->server['REQUEST_URI'], '/') =='sitemap.xml') {
$this->request->get['route'] = 'extension/feed/sitemap_ml';
return;
}
After editing, you need to update the cache of modifiers in the admin panel in the Modification section.
What does "Divide into parts" mean?
When the "Divide into parts" option is enabled, several Sitemaps will be created by type: pages, categories, manufacturers, products, blog, etc. All these Sitemaps will be combined by the Sitemap Index, which will need to be add in the robots.txt file or sent to Google Search Console. The robot will scan the index map of the OpenCart site and find all your maps there by itself.
This option can be useful if you have a lot of pages and the normal map is too large or takes a long time to load. Also, the module has the possibility to create several cards with goods, evenly dividing the goods into several parts.
How do rename static sitemap files?
Open the file: catalog/controller/extension/feed/sitemap_ml.php
In line 3 you can change the file name:
private $filename = 'sitemap';
For example:
private $filename = 'my-sitemap';
Why doesn't the static sitemap open?
In the .htaccess file located at the root of the site, find the line and delete or comment on it with the symbol #:
RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap [L]
What is Priority?
Priority - the internal priority of the pages, ie the importance of some pages over others. The most important pages on the site should have a priority of "1.0", the least important - "0.1".
There are no rules about what priority should be in certain types of pages, it's all customizable.
For example, if the home page is the most important on your site, its priority should be set to "1.0". Also in the online store are very important product pages - they can be given priority - "0.9". Categories - "0.8", manufacturers - "0.7", etc.
Recently it became known that Google no longer reads this parameter, so it can be omitted in the sitemap. As for other search engines, their position is unknown.
What is Changefreq (Frequency)?
Changefreq is the approximate refresh rate of the page content. Possible values: always, hourly, daily, weekly, monthly, yearly, never, that speak for themselves.
Example: if you change something in the product every day, such as a description or image, then you need to choose "daily", but if you add the product and forget about it, then you should choose "monthly" or even "yearly".
Recently it became known that Google no longer reads this parameter, so it can be omitted in the sitemap. As for other search engines, their position is unknown.
What is Lastmod?
Lastmod is the date the page was last updated. That is, after each editing of the page in the lastmod parameter, the date must be updated and this should indicate to the search engine that this page should be scanned as soon as possible.
What is a static sitemap?
A static sitemap is an xml file on the server that contains a list of site URLs for indexing. The static map needs to be updated periodically to keep it up to date. The advantage of a static map is that it is already generated and does not depend on the speed of the server and database. This type of sitemap.xml should be used with a large number of pages on the site, for example, if a large catalog of goods in the online store.
What is a dynamic sitemap?
A dynamic sitemap is a script that generates a sitemap.xml when accessed. The advantage of this type of map is the constant relevance of the data. The disadvantage is the constant load on the server, each time the search bot; data download speed. This map should be used for small sites or sites on a powerful server.
Why in ocStore 3.x with SEO Pro enabled is the product URL generated without categories?
This is an ocStore 3.x issue, you can call it an ocStore build bug. Canonical product URLs are generated without categories, even if this is specified in the SEO Pro settings. Therefore, in the CNC site map, products are also formed without categories.
But this can be solved by installing the modifier -
download.
After its installation, update the cache of modifiers and reset the system cache.
If you have a static sitemap, you need to update it.
What does "Protect access to the sitemap" and "Sitemap access key" mean and why is it necessary?
You can hide the map from others, its URL can be known only to you and the search engine. This is what the "Protect access to the sitemap" option is for.
"Sitemap access key" is any phrase that will be added as a get-parameter to the link to generate the sitemap.
Examples of why Sitemap protection is needed:
-
Many parsers work based on the Sitemap file, so you can protect yourself from parsing.
-
DDoS protection. A dynamic sitemap puts a heavy load on your server because it pulls so much data at once. Attackers can take advantage of this by setting a link in your sitemap to run periodically. This will cause the server to become overloaded, slow down, or fail altogether.
Usually it is not necessary to protect the Sitemap, but if you have such a need - there is an opportunity.