SEO – Crawlability SEVERITY
-
Google PageSpeed Insights reports a crawlability issue under “Crawling and
Indexing → Links are not crawlable.”The Like and Dislike buttons are currently rendered as anchor elements
with href=”javascript:void(0)” attributes. This construction violates SEO
best practices because:- Search engine crawlers (Googlebot) may attempt to follow these links
- javascript: protocol links are not valid URLs and cannot be crawled
- This creates unnecessary crawl errors in Google Search Console
- It’s semantically incorrect for JavaScript-triggered actions
- Accessibility standards (WCAG) recommend using for JavaScript actions
AFFECTED FILES:
- /inc/views/frontend/like.php
- /inc/views/frontend/dislike.php
================================================================================ PROPOSED SOLUTION:
Replace all Like/Dislike anchor elements with semantic elements. CHANGES REQUIRED: File: /inc/views/frontend/like.php
Replace:
<a href=”javascript:void(0)” class=”pld-like-trigger pld-like-dislike-trigger…” With:
<button type=”button” class=”pld-like-trigger pld-like-dislike-trigger…” Remove the href attribute entirely and use proper tag instead. File: /inc/views/frontend/dislike.php
Same replacement as above:
<a href=”javascript:void(0)” class=”pld-dislike-trigger pld-like-dislike-trigger…” With:
<button type=”button” class=”pld-dislike-trigger pld-like-dislike-trigger…” File: /js/pld-frontend.js (Minor optimization)
Line 56 – Update selector reference from ‘a’ to ‘.pld-like-dislike-trigger’ Change from:
selector.closest(‘.pld-like-dislike-wrap’).find(‘a’).data(‘already-liked’, 1); To:
selector.closest(‘.pld-like-dislike-wrap’).find(‘.pld-like-dislike-trigger’)
.data(‘already-liked’, 1); ================================================================================ BENEFITS OF THIS SOLUTION: ✓ Resolves Google PageSpeed Insights crawlability warning
✓ Improves accessibility (WCAG compliance)
✓ Semantically correct HTML markup
✓ No breaking changes to existing functionality
✓ No changes to styling or user experience
✓ Event listeners continue to work with elements
✓ Reduces crawl errors in Google Search Console ================================================================================ BACKWARD COMPATIBILITY: This change is fully backward compatible: Event delegation (jQuery .on(‘click’)) works with button elements Data attributes remain unchanged CSS classes and styling are preserved No database changes required Existing website functionality is not affected ================================================================================ IMPLEMENTATION NOTES: The jQuery event listener uses event delegation and class-based targeting,
not element type, so it works seamlessly with elements All data attributes (data-post-id, data-trigger-type, etc.) remain intact CSS styling may need minor adjustments for button element defaults
(recommendation: add “appearance: none; border: none; background: transparent;”
to reset default button styling if needed) ================================================================================ RECOMMENDATION: Implement these changes in the next update to improve: SEO compliance Accessibility standards Overall code quality and best practices This is a non-breaking change that will benefit all users of the plugin.
You must be logged in to reply to this topic.