Book Image

Magento 2 - Build World-Class online stores

By : Fernando J Miguel, Ray Bogman, Vladimir Kerkhoff, Bret Williams, Jonathan Bownds
Book Image

Magento 2 - Build World-Class online stores

By: Fernando J Miguel, Ray Bogman, Vladimir Kerkhoff, Bret Williams, Jonathan Bownds

Overview of this book

Magento is the leading e-commerce software trusted by world`s leading organizations. Used by thousands of merchants for their transactions worth billions, it provides the flexibility to customize the content and functionality of your website. Our Magento Course will help you gain knowledge and skills that are required to design & develop world class online stores. Magento 2 Development Essentials - This book begins by setting up Magento 2 before gradually moving onto setting the basic options of the Sell System. You will learn Search Engine Optimization aspects, create design and customize theme layout, and adjust the Magento System to achieve great performance. Magento 2 Cookbook – This book is divided into several recipes, which show you which steps to take to complete a specific action. It will cover configuring your categories and products, performance tuning, creating a theme, developing a module etc. At the end of this book, you will gain the knowledge to start building a success website. Mastering Magento 2 - This is a comprehensive guide to using the all new features and interface of Magento 2 to build, extend, and design online stores. This book is your roadmap to managing your Magento store which teaches advanced and successful techniques. Focusing on Magento's Community version, this book offers you advanced guidance on managing, optimizing, and extending your store while taking advantage of the new features of Magento 2. This Learning Path combines some of the best that Packt has to offer in one complete, curated package. It includes content from the following Packt products • Magento 2 Development Essentials by Fernando J. Miguel • Magento 2 Cookbook by Ray Bogman and Vladimir Kerkhoff • Mastering Magento 2 by Bret Williams and Jonathan Bownds
Table of Contents (6 chapters)

Chapter 3. Working with Search Engine Optimization

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

Magento SEO management

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.

Store configuration

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.

Store configuration

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.

SEO and searching

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:

SEO and searching

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.

SEO and searching

Here, you can simply choose Request Path to edit and enter a description for each of them, as shown in the following screenshot:

SEO and searching

In Search Terms, you can define and redirect the URL according to the search made by the user by adding a new search term:

SEO and searching

Finally, in the New Site Map section, you can generate Sitemap of your Magento installation as shown in the following screenshot:

SEO and searching

SEO catalog configuration

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:

SEO catalog configuration

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.

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:

XML sitemap manager

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:

XML sitemap manager

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 tracking code

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.

Optimizing Magento pages

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.

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:

CMS pages

Magento's default installation provides some demo content to test CMS pages. Check the Home Page content by selecting the Edit option.

CMS pages

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:

  • Page Title: This should correspond to the main title of the page
  • URL Key: This is very important to set a great Search Engine Friendly (SEF) URL identifier to increase SEO ranking
  • Store View: Here, you can choose the views on the page
  • Status: This has simple Enabled and Disabled 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.

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:

Product pages

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:

  • Name: You need to make this descriptive; think about what people might search for
  • Description: Here, you must detail the product as much as possible to make your content unique and helpful to users
  • Categories: This is the category of the product.

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.
    Product pages

Every single product gives the administrator these options to tune SEO on a Magento website.

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:

Category pages

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:

CMS pages

Magento's default installation provides some demo content to test CMS pages. Check the Home Page content by selecting the Edit option.

CMS pages

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:

  • Page Title: This should correspond to the main title of the page
  • URL Key: This is very important to set a great Search Engine Friendly (SEF) URL identifier to increase SEO ranking
  • Store View: Here, you can choose the views on the page
  • Status: This has simple Enabled and Disabled 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.

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:

Product pages

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:

  • Name: You need to make this descriptive; think about what people might search for
  • Description: Here, you must detail the product as much as possible to make your content unique and helpful to users
  • Categories: This is the category of the product.

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.
    Product pages

Every single product gives the administrator these options to tune SEO on a Magento website.

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:

Category pages

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:

Product pages

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:

  • Name: You need to make this descriptive; think about what people might search for
  • Description: Here, you must detail the product as much as possible to make your content unique and helpful to users
  • Categories: This is the category of the product.

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.
    Product pages

Every single product gives the administrator these options to tune SEO on a Magento website.

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:

Category pages

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:

Category pages

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.

Summary

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!