Storefront compare product creates Google SEO error - Links are not crawlable
Preconditions and environment
- Magento version 2.4.8, Luma Theme Check web page www.firesupport.uk using google search console Produces SEO error Links are not crawlable code in error is Compare Products
Please can you fix this is the base code or tell me how to get this fixed in the meantime so as to keep google happy.
Steps to reproduce
go to google search console run page speed insights on www.firesupport.uk see results for SEO We use Luma theme
Expected result
passes google SEO and has a crawlable link
Actual result
Google SEO error
Links are not crawlable Search engines may use href attributes on links to crawl websites. Ensure that the href attribute of anchor elements links to an appropriate destination so that more pages of the site can be discovered. Learn how to make links crawlable Uncrawlable link Compare Products
Additional information
this is the corrected code according to AI - Compare Products
but whilst waiting for a proper fix how and where can I code this on my web to make the compare product SEO friendly?
Release note
updated storefront compare products to have a crawlable url to make the web site more google friendly
Triage and priority
- [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- [x] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Hi @fabotha. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.
- For more details, review the Magento Contributor Assistant documentation.
- Add a comment to assign the issue:
@magento I am working on this - To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
- [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced on 2.4.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here! - [ ] 5. Add label
Issue: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hi @fabotha,
Thanks for your reporting and collaboration.
We have tried to reproduce the issue in Latest 2.4-develop instance and we are able to reproduce the issue.Kindly refer the screenshots.
Hence Confirming the issue.
Thanks.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-15547 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
any change of a temporary fix, if you can tell me what and where to code the override html to make the compare more friendly to google. thank you Copilot suggested
<!--` Static fallback for SEO -->
<a href="/compare-products" class="action compare fallback-link" rel="nofollow">Compare Products</a>
<!-- Knockout dynamic link (Magento default) -->
<!-- ko if: compareProducts().listUrl -->
<a class="action compare" data-bind="attr: { href: compareProducts().listUrl }">
Compare Products
</a>
<!-- /ko -->
Explanation • The first tag is a static fallback with a crawlable . You can style it with CSS to hide it if needed, but ideally keep it visible for accessibility. • The second tag is Magento’s dynamic Knockout binding. It will render the correct URL when JS loads, but Googlebot may not see it unless it fully renders the page. • The is optional—it tells Google not to pass link equity, which is common for compare or cart links.
Optional CSS to hide fallback
also CSS
.fallback-link {
position: absolute;
left: -9999px;
}
This keeps the link in the DOM for crawlers but hides it from users. Use with care—Google may ignore hidden links if it suspects manipulation.
But I have no idea if it will work and where to put it
Hi @fabotha,
Adobe Commerce Engineering team started working on this issue. We will reach out to you if we need more information and you will get notified once the issue is fixed. Please leave comments for any further questions. Thank you!