I have two errors on my PageSpeed insights and curious as to how I can go about fixing these two issues. I have researched considerably, but have not found a solution as of yet.
Error 1:
Document doesn’t have a <title> element
Failing Elements:
html.js
Error 2:
Document does not have a meta description
Meta descriptions may be included in search results to concisely summarize page content.
Regarding error 2, I have a Meta Description for the homepage.
I’ll be happy to help you with fixing those two errors.
Error 1: Document doesn’t have a element
To address this issue, you need to add a tag within the section of your theme.liquid. The tag should include a brief and descriptive title for your webpage that summarizes its content. Here’s an example of what your HTML code should look like:
Make sure to replace “Page Title Goes Here” with an appropriate and descriptive title for your webpage.
Error 2: The document does not have a meta description
To address this error, you should add a meta description tag within the section of your theme code. The meta description should be a brief summary of the content of your webpage and should be no longer than 160 characters. Here’s an example of what your HTML code should look like:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Page Title Goes Here</title>
<meta name="description" content="A brief description of your webpage's content.">
</head>
<body>
<!-- Page content goes here -->
</body>
</html>
Make sure to replace “A brief description of your webpage’s content.” with a concise summary of your webpage’s content.
After making these changes, rerun the PageSpeed insights tool to verify that the errors are fixed. If you have any other questions or concerns, feel free to ask!``
Thank you for your response and sorry for the late reply. I was able to add the code as you described and works properly now. My only question is, will this take effect of every product page I have or only the landing page?
If it alters the product pages as well, what can I do so that not every product has the same product meta description?
Glad to hear that the code worked for you! The changes made in the “theme.liquid” file will apply to all pages that use your theme, including product pages.
If you don’t want every product to have the same meta description, you have a couple of options:
Manually Edit Individual Product Pages: You can go into each product page and edit the meta description manually in the “Search engine listing preview” section of the product editor.
Use an App: There are several Shopify apps available in the Shopify App Store that allow you to create and manage unique meta descriptions for each product. One such app is “SEO Manager” by venntov, which provides a wide range of SEO tools, including the ability to bulk edit meta descriptions for your products. Using an app can streamline the process of updating meta descriptions across many products, saving you time and effort.
All of our products have unique meta descriptions written in the “Search engine listing preview”. I guess my question is, did the code I changed/added in the Theme.Liquid overwrite/override my products meta descriptions?