For complicated reasons, we can't use
<a href=""> tags on part of one of our pages.
If we use
<button role="link">, will Search Engines crawl the page? If not, is there another way to tell google to crawl
Webmasters Stack Exchange is a question and answer site for pro webmasters. It only takes a minute to sign up.Sign up to join this community
var s="/foo/bar.html" Google will likely try to crawl
/foo/bar.html to see if it can find a page there. In my experience Googlebot will try to crawl any reasonable length string literal than contains a slash but no spaces. Googlebot is likely to miss URLs that don't look enough like URLs or ones which are built from other smaller strings.
return false or
event.preventDefault to change the content without having the browser load a whole new page.
If you really can't use
<a> tags, I'd recommend putting the URLs into
data attributes on the buttons. Google should be able to crawl those as well. See Does Googlebot crawl items that look like URLs in HTML5 data-* attributes? I don't know if those would pass link juice either, but I'd find it more plausible that they would do so.
On possible solution would be to use forms instead of buttons. The official Google blog says Googlebot follows GET-based forms. So if you want your button crawled, surround it using a form tag using a
GET action. Then the URL will be indexed.
Unfortunately, no. If you need to change a tag name, it's better to replace it with
<a> , instead of