Search Engine Optimization (SEO) is a technique to build your site following good practices established by W3C Consortium and search engines, such as Google, to increase your site's visitation and ranking. On Magento, we need to configure the system properly to take advantage of this feature. Nowadays, SEO is a prerequisite on every website on the Internet.
Magento has a great variety of tools to configure the store of SEO and allows SEO adjustment for products, categories and CMS page titles, metainformation, and headings.
SEO application is a constant job; it never ends. Basically, you need to know how Magento SEO works and what options you have to optimize its working. Magento is a search engine-friendly e-commerce platform, and you will discover its main concepts in this chapter.
In this book, you will learn some good techniques and apply them by configuring the default installation.
The following topics will be covered in this chapter:
- Magento SEO management
- SEO catalog configuration
- XML sitemap manager
- Google Analytics tracking code
- Optimizing Magento pages, products, and categories
SEO is the technique of developing a site according to the high standards defined by the World Wide Web Consortium and search engine companies, such as Google, in order to provide good content visualization to the users and rank the site in organic searches.
Magento provides the user with some significant tools for SEO. Let's take a look at some of these techniques and tools.
By default, Magento's basic installation has the title Magento Commerce
on the header settings. It is very important to choose a strong main title to get the right amount of traffic on your site. For example, if you are working on the SEO of a sports store, you can set the main title as My Sports Store to increase the traffic through the title. When people search for something, they always notice the earlier words first.
To adjust your store settings, you need to navigate to Stores | Configuration | Design | HTML Head in the Magento admin area (http://localhost/packt/admin-packt
).
Choose a good descriptive title for your Magento commerce. It is possible and recommended to name all your page titles, including categories and products, by entering the site title in the Title Suffix field. To give density to the content for SEO engines by configuring the SEO on CMS pages and products, keep Default Description and Default Keywords empty.
For a local and nonproduction environment, prevent the indexing of the site by setting Default Robots to NOINDEX, NOFOLLOW
. Otherwise, it is recommended to set it to INDEX, FOLLOW
.
By working on this configuration, you will find that the main SEO parameters of the <head>
tag are automatically fulfilled to be run on Magento commerce.
Magento has a specific SEO configuration panel for multiple sections. To access the main Magento SEO configuration, enter in the Magento admin area (http://localhost/packt/admin-packt
), and you will find the panel by clicking on the menu at Marketing | SEO & Search:
Magento 2.0 changed some functionality in comparison with its previous version. For example, in the URL Rewrites menu, you can manage and define all the URL addresses of Magento in order to increase the SEO's friendly URLs.
Here, you can simply choose Request Path to edit and enter a description for each of them, as shown in the following screenshot:
In Search Terms, you can define and redirect the URL according to the search made by the user by adding a new search term:
Finally, in the New Site Map section, you can generate Sitemap of your Magento installation as shown in the following screenshot:
Magento has a special panel to take care of the catalog categories of SEO. To access this panel, navigate to Stores | Configuration | Catalog | Search Engine Optimization, as follows:
This panel has the following options:
- Popular Search Terms: This allows pages to display your most popular search phrases. Set this to Yes.
- Product URL Suffix: This is the suffix that is added to the end of your product URLs.
- Category URL Suffix: This is the suffix that is added to the end of your category URLs.
- Use Categories Path for Product URLs: This includes the category URL in your URL string.
- Create Permanent Redirect for URLs if URL Key Changed: This automatically creates a redirect via the URL Rewrites' module in Magento if the URL key is changed in any page on your website.
- Page Title Separator: This separates the page titles on the frontend of your store.
- Use Canonical Link Meta Tag For Categories: This displays the main version of the category page. This is picked up by search engines to avoid duplicate content.
- Use Canonical Link Meta Tag For Products: This has the same functionality as the previous item, but it works on the products layer.
With these options, you can choose the best strategy for SEO on catalog's default options. Magenta gives the administrator the opportunity to tune these options on catalog pages. We will work this out later in this chapter.
Magento automatically generates an XML sitemap for your store and also keeps it up to date. In order to enable this, navigate to Stores | Configuration | Catalog | XML Sitemap. Magento has the following options for this section:
Basically, with these options, it is possible to choose the frequency and priority of updates. You may set additional options, such as Start Time and Error Notifications, only in the GENERAL settings tab. It's important to configure the cron job functionality in your web server to enable this feature.
XML sitemap manager
Magento automatically generates an XML sitemap for your store and also keeps it up to date. In order to enable this, navigate to Stores | Configuration | Catalog | XML Sitemap. Magento has the following options for this section:
Basically, with these options, it is possible to choose the frequency and priority of updates. You may set additional options, such as Start Time and Error Notifications, only in the GENERAL settings tab. It's important to configure the cron job functionality in your web server to enable this feature.
Google Analytics helps track all the statistics for your site. To add Google Analytics on Magento, generate a tracking code on your Google Analytics account (http://analytics.google.com) first of all. After this, navigate to System | Configuration | Google API.
This option works only on hosted Magento sites (that is, the remote server). Take note of this for when you work on a remote production Magento site. For the purposes of this book, it isn't necessary, but you need to keep this option in mind when you start to work on remote projects.
Once you make Magento SEO system configurations, it's time to set specific options directly on Magento pages. This Magento SEO flow gives the user the flexibility to focus on content and page ranking.
The Magento Content Management System (CMS) manager is a very simple but powerful tool that provides us with control over each aspect of the Magento page. To access Magento CMS pages configuration in the admin area, go to Content | Pages, as shown in the following screenshot:
Magento's default installation provides some demo content to test CMS pages. Check the Home Page content by selecting the Edit option.
For the purpose of SEO, Magento's CMS page administration has two main SEO side menus: Page Information and Meta Data.
In Page Information, you can set the following options:
In Meta Data, you can set the following options:
- Keywords: Here, enter the keywords that correspond to your site's scope.
- Description: Make sure to use this field the right way. A good description means a good chance of increasing access and sales.
The content of your page must be aligned with the metadata for a good SEO implementation.
This is the most important layer in a Magento store. Besides providing a lot of options to configure the product to be sold, this also makes it possible to tune the SEO configuration to increase sales through the search engine page ranking system. In order to access Product options, navigate to Products | Catalog, as shown in the following screenshot:
Click on the first product of the list to take a look at the SEO options. For the purpose of SEO, Product Details has the following options:
Search Engine Optimization has the following options:
- URL Key: This is the URL that the product will be visible on. If the product has a version number or some specific detail, try to put this on the URL.
- Meta Information: Choose the best Meta Title, Meta Keywords, and Meta Description input for your product.
Every single product gives the administrator these options to tune SEO on a Magento website.
Magento category pages have great SEO options. As you can note, all the content pages on Magento give us administration options to manage SEO. Every aspect on Magento configuration is integrated to provide the user with the best experience.
To access the Categories configuration, navigate to Products | Categories on the admin dashboard, as shown in the following screenshot:
This will provide an option to create a new category, and in the side menu, it is possible to check all the categories registered on Magento. For the purpose of SEO, Magento has the following options in this section:
- Name: This is the category name.
- Description: This is the description of the category. Focus on using keywords strategically for SEO.
- Page Title: This refers to the metatitle. Enter your keyword with a few words to describe the page.
- Meta Keywords: Here, enter the keywords separated by commas.
- Meta Description: This is a very important option, so make sure that your description covers the products that you're selling and reinforces your brand.
Make sure to follow a pattern in your content referring to SEO.
CMS pages
The Magento Content Management System (CMS) manager is a very simple but powerful tool that provides us with control over each aspect of the Magento page. To access Magento CMS pages configuration in the admin area, go to Content | Pages, as shown in the following screenshot:
Magento's default installation provides some demo content to test CMS pages. Check the Home Page content by selecting the Edit option.
For the purpose of SEO, Magento's CMS page administration has two main SEO side menus: Page Information and Meta Data.
In Page Information, you can set the following options:
In Meta Data, you can set the following options:
- Keywords: Here, enter the keywords that correspond to your site's scope.
- Description: Make sure to use this field the right way. A good description means a good chance of increasing access and sales.
The content of your page must be aligned with the metadata for a good SEO implementation.
This is the most important layer in a Magento store. Besides providing a lot of options to configure the product to be sold, this also makes it possible to tune the SEO configuration to increase sales through the search engine page ranking system. In order to access Product options, navigate to Products | Catalog, as shown in the following screenshot:
Click on the first product of the list to take a look at the SEO options. For the purpose of SEO, Product Details has the following options:
Search Engine Optimization has the following options:
- URL Key: This is the URL that the product will be visible on. If the product has a version number or some specific detail, try to put this on the URL.
- Meta Information: Choose the best Meta Title, Meta Keywords, and Meta Description input for your product.
Every single product gives the administrator these options to tune SEO on a Magento website.
Magento category pages have great SEO options. As you can note, all the content pages on Magento give us administration options to manage SEO. Every aspect on Magento configuration is integrated to provide the user with the best experience.
To access the Categories configuration, navigate to Products | Categories on the admin dashboard, as shown in the following screenshot:
This will provide an option to create a new category, and in the side menu, it is possible to check all the categories registered on Magento. For the purpose of SEO, Magento has the following options in this section:
- Name: This is the category name.
- Description: This is the description of the category. Focus on using keywords strategically for SEO.
- Page Title: This refers to the metatitle. Enter your keyword with a few words to describe the page.
- Meta Keywords: Here, enter the keywords separated by commas.
- Meta Description: This is a very important option, so make sure that your description covers the products that you're selling and reinforces your brand.
Make sure to follow a pattern in your content referring to SEO.
Product pages
This is the most important layer in a Magento store. Besides providing a lot of options to configure the product to be sold, this also makes it possible to tune the SEO configuration to increase sales through the search engine page ranking system. In order to access Product options, navigate to Products | Catalog, as shown in the following screenshot:
Click on the first product of the list to take a look at the SEO options. For the purpose of SEO, Product Details has the following options:
Search Engine Optimization has the following options:
- URL Key: This is the URL that the product will be visible on. If the product has a version number or some specific detail, try to put this on the URL.
- Meta Information: Choose the best Meta Title, Meta Keywords, and Meta Description input for your product.
Every single product gives the administrator these options to tune SEO on a Magento website.
Magento category pages have great SEO options. As you can note, all the content pages on Magento give us administration options to manage SEO. Every aspect on Magento configuration is integrated to provide the user with the best experience.
To access the Categories configuration, navigate to Products | Categories on the admin dashboard, as shown in the following screenshot:
This will provide an option to create a new category, and in the side menu, it is possible to check all the categories registered on Magento. For the purpose of SEO, Magento has the following options in this section:
- Name: This is the category name.
- Description: This is the description of the category. Focus on using keywords strategically for SEO.
- Page Title: This refers to the metatitle. Enter your keyword with a few words to describe the page.
- Meta Keywords: Here, enter the keywords separated by commas.
- Meta Description: This is a very important option, so make sure that your description covers the products that you're selling and reinforces your brand.
Make sure to follow a pattern in your content referring to SEO.
Category pages
Magento category pages have great SEO options. As you can note, all the content pages on Magento give us administration options to manage SEO. Every aspect on Magento configuration is integrated to provide the user with the best experience.
To access the Categories configuration, navigate to Products | Categories on the admin dashboard, as shown in the following screenshot:
This will provide an option to create a new category, and in the side menu, it is possible to check all the categories registered on Magento. For the purpose of SEO, Magento has the following options in this section:
- Name: This is the category name.
- Description: This is the description of the category. Focus on using keywords strategically for SEO.
- Page Title: This refers to the metatitle. Enter your keyword with a few words to describe the page.
- Meta Keywords: Here, enter the keywords separated by commas.
- Meta Description: This is a very important option, so make sure that your description covers the products that you're selling and reinforces your brand.
Make sure to follow a pattern in your content referring to SEO.
Magento SEO is a powerful tool to increase sales. As a developer, it is very important to keep these options and techniques in mind to create mechanisms that would get better results for Magento users through new extensions and customizations.
In this chapter, we discussed the following:
- Magento SEO management
- SEO catalog configuration
- XML sitemap manager
- Google Analytics tracking code
- Optimizing Magento pages, products, and categories
In the next chapter, we will cover Magento theme development and customization. We have a lot of work coming up!