简体   繁体   中英

How to fix Links are not crawlable on Google Lighthouse

I got error while running google lighthouse. the warning is Link not crawable. this is the warning from google lighthouse.

<a href="https://www.mywebsite.com/en/test.html" id="multipleStore" target="popup" onclick="window.open('https://www.mywebsite.com/en/test.html','My popup windows open','resizable,height=480,width=875'); return false;">
                <p>click me</p>
            </a>

To prevent Google from crawling your link do not use a URL and use script instead.

If you use something like this Google Crawler (respectively Lighthouse) will ignore the link:

<a href="javascript:void(0)" onclick="openPopup()" class="link">click me</a>
<script>
function openPopup() {
    window.open('https://www.google.com/', 'Popup', 'width=400,height=875')
}
</script>

Example: https://codepen.io/headstarterz/pen/eYgMaew

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM