Configuring Basic SEO For Magento 2

under Magento SEO.

As we've discussed, Magento as a platform has issues with SEO. It's not that Magento can't be configured to meet your SEO needs, since the platform is wide open and ripe for development. The issue is that SEO implementations in Magento can be time and resource expensive.

Even so, there are several out-of-the-box basic SEO features that Magento makes available and that you should configure right off the bat.

Here are some important changes you should make to your Magento setup, specifically for Magento 2, to make sure that some basic optimization is in place.

How To Set The Homepage Title

The title tag on your homepage should target your brand's primary top-level keyword, as well as your brand name. To set the title tag for the homepage, start by clicking "content" in the left navigation:

select content from left navigation

Now navigate to "Pages"

navigate to pages

Now navigate to the "Home Page" in the table, click on "Select" and choose "Edit" from the dropdown menu:

select edit for homepage

Now edit the Page Title field. We recommend using a format like this:

edit homepage page title field

Where an enticing headline containing your primary target keywords is listed up front, followed by a pipe "|" and then your brand name. If people are more likely to be searching for your brand name than even your top level keywords, you can switch it around to something along the lines of "[Brand Name]: [Keywords In Enticing Headline]."

Once you have edited the Page Title, click the "Save Page" button to update it on the front end so that it is visible to users. If you plan to make other edits to the homepage content, you can alternatively click the "Save and Continue Edit" button.

save homepage title

Setting Individual Product Page Title Tags, Meta Descriptions, and URLs

Your product pages should feature a title tag that includes not just the product name, but relevant keywords other than the brand and model name, and it should serve to entice the user to click through.

You will also want to edit the meta description on your product, provided you can include a customized one, since this is what generates the snippet of text below your headline in the search results and further entices users to click through.

It's also best if your URL incorporates some keywords rather than just listing the brand and model name for your product.

First, navigate to "Catalog," then select "Products" from the pop-out menu, like so:

catalog then products

Now navigate to the product you need to update and click "Edit" under the "Actions" column:

product actions, choose edit

Now navigate down to the "Search Engine Optimization" card and click on it to expand it. You will see this:

product seo settings

Ignore the "Meta Keywords" tag, unless you want to fill it out for random crawlers and bots other than search engines, which no longer use the tag.

The "URL Key" is what you can use to adjust the key that appears at the end of your URL, at the bottom of the folder structure. You will want to edit it to include not just the product name, but relevant keywords, without keyword stuffing. For example:

product url key

Make sure that the "Create Permanent Redirect for old URL" checkbox is selected. Leaving this empty will create broken links on your site. The redirect ensures that anybody who clicks old links will still end up on the correct product page, and sends the PageRank from the old URL to the new one so that it isn't lost.

Your title tag goes in the "Meta Title" field. Make sure to use an eye-catching title that includes your product name as well as keywords related to the product, so that people who search for products of this type, rather than just the product name, will be able to find it. Here is an example:

product title

In the "Meta Description" field, enter a product description that will show up in the text snippet beneath your title tag in the search results. To ensure that the full description is visible in the search results, keep it between about 150 and 160 characters. Magento 2 doesn't include a counter to tell you how many characters are in your description, so use your word processor of choice and run a character count to make sure the length is appropriate.

Your meta description's primary purpose is to inform users about the product and entice them to visit your product page. Include any keywords that you would want to appear as bold to searchers who used them in their query, but be aware that the meta description does not directly influence rankings, so working keywords into the content is entirely for the user's benefit.

After editing your URL key, meta title, and meta description, click the "Save" button in the top right:

save product page

Changing Default Settings For Title Tags and Meta Descriptions

While setting custom title tags and meta descriptions for each product is ideal, it isn't always possible, especially if your store features thousands of products. We still recommend setting custom values for these fields for your highest performing and most promising products, but for everything else, it is possible for you to adjust the global default settings so that the automatically generated metadata is better optimized for your needs.

To do this, start by navigating to "Stores" in the left navigational menu and then selecting "Configuration" from the pop-out menu:

stores then configuration

Now open the "Catalog" pop-out and click the "Catalog" option underneath it:select catalog from configuration

You will see a "Product Fields Auto-Generation" section that looks like this:

product fields auto-generation

Here is where you can set rules for how your title tags and meta descriptions display by default, if you don't include any custom information.

You can include any attribute that is part of the attribute set you have set up for your store.

The title tag by default is the name of the product. At the very least, we recommend editing this to include your store's brand name:

mask for meta title

You will need to uncheck the "Use system value" checkbox to edit the title tag rule. We recommend adding a space, followed by a pipe "|", followed by another space, and then your brand name (no square brackets).

If your site's attribute set affords you the options, you can generate more useful dynamic titles, for example:

  • {{name}}: a {{keyword}} | [Brand Name]
  • {{name}} for only {{price}} | [Brand Name]
  • {{name}} in {{size}} for {{gender}}

The biggest limitation is that these settings are global, so they can't be specified separately for each category.

By default, the meta description uses "{{name}} {{description}}" which is generally a pretty bad meta description. We definitely recommend removing the {{name}} field since it typically will not flow naturally into the product description.

Unless your product descriptions are all set to be between 150 to 160 characters, we do not recommend using the {{description}} field here either. All this will do is force the snippet to include the opening of your product description, which will cut off after about 160 characters.

It may sound odd, but unless you have enough attributes in your set to create an enticing and unique dynamic meta description for every product page, it is honestly best to leave this field entirely blank. Google's automatically generated snippet is better than forcing the snippet to include only the opening of your product description, since Google's automatic snippets are dynamic based on the user's query,  and display the most relevant part of the page.

If you are using attributes to generate a dynamic meta description, monitor your traffic to estimate whether there is a positive or negative impact on clicks vs Google's automatic snippets.

Our recommendation is always to include a fully custom meta description if you can. When you can't, Google's automatic snippets are often better than any dynamic description you can create yourself.

Enable Canonicalization For Categories And Products

Magento has a tendency to create duplicate content as a result of filtering on Category and Product pages. Since each filter creates a different version of the page at a different URL, Google may see these pages as different from one another. Since they share the same title tag and the content is nearly identical, this leads to duplicate content issues that can dilute your SEO authority and rank a less helpful version of the page.

To combat this, you can enable canonicalization, which uses the rel=canonical tag to tell Google and other search engines that the primary URL for each category and product page is the "official" version that search engines should use, that the filtered versions shouldn't show up in search results, and that any authority to the filtered pages should go to that version.

As with "Product Fields Auto-Generation," this setting is also under the Catalog > Configuration > Catalog > Catalog section. You will find it if you scroll down to the "Search Engine Optimization" section. Next to "Use Canonical Link Meta Tag For Categories," uncheck the "Use system value" checkbox and change the drop down menu selection to "Yes." Do the same for "Use Canonical Link Meta Tag For Products."

enable canonicalization

Bear in mind that this solution still isn't ideal, since search engines do not always obey the canonical tag and treat it more as a suggestion. The best solution is to ensure that duplicate URLs are not generated by filtering in the first place, which will require some development effort.

While you are here, we recommend checking to verify that "Use Categories Path for Product URLs" is set to "No" so that a product listed in multiple categories will not result in two different URLs for the same product. If and only if you have a strict policy of including products in only one category should you set this to "Yes." Doing so does have its advantages, since it creates a folder taxonomy that makes semantics clearer to search engines, but again, every product must strictly be included in only one category if this is the case.

Also make sure that "Create Permanent Redirect for URLs if URL Key Changed" is set to "Yes," so that if you ever change a URL, any links that still point to the old page will be redirected to the new page and your loss in SEO value is mitigated.

Where To Edit Robots.txt and Your XML Sitemap

Only developers who are familiar with editing robots.txt and your XML sitemap should use these features.

You can reach robots.txt by going to Stores > General > Design. 

To tune how Magento 2 sets up your XML sitemap, navigate to Stores > Configuration > Catalog > XML Sitemap.

Make sure that the frequency is set to daily or more for the sitemap refresh. You do not want new products to be invisible to search engines because the sitemap isn't updated to point search engines to their location.

Where To Set Image Alt Tags

The image alt tag is meant to serve as replacement text for an image if it can't load or if the user is visually impaired. Search engines also use it to understand what the image is about. Including a short image alt that clarifies what the image is helps with your SEO and html compliance.

You can edit the image alt tags in Product > Basic Settings > Images and Videos > Alt Text.

You should also update your store logo's alt test from "Magento Commerce" to your business name by going to Stores > Configuration > General > Design > HTML Head > Header and updating the "Logo Image Alt" field.

Conclusion

While some SEO implementations in Magento 2 are very difficult to implement, taking advantage of its out-of-box SEO features is important and straightforward. Make the changes above to get your most important basic SEO configurations in place.