3

I'm developing a SPA using Ionic, and for performance, UX, and indexing reasons I'd like to use <span> tags instead of <a> tags, as the latter doesn't work very well with Ionic's stack-based navigation system (it causes a page reload). I.e. instead of this:

<a href="faqs">FAQ</a>

I'd like to use this:

<span onclick="openPage('FaqsPage')" rel="dofollow">FAQ</span>

Will the dofollow value work as expected? I.e. will Google (and potentially other) crawlers know to follow this link as part of my site, even though it is a span rather than an a tag?

  • UPDATE: Looks like I can just use an anchor tag and call event.preventDefault, like so: <a href="#" (click)="$event.preventDefault(); openPage('FaqsPage')">FAQ</a> – Sensei James Jun 1 '18 at 17:44
2

There is no such thing as a rel="dofollow" tag. The good news is, you don't need anything of the sort. All links are "follow" by default, unless specified otherwise (in a rel="nofollow" or a robots meta tag).

However, since you're using JavaScript onclick events for your links, you may want to take extra measures to ensure than Google understands these links. So you'd want to specify the URL somewhere in there, or somewhere on the page that would make it clear to search engines what the intended link URL is. (More info on the subject here: https://www.seroundtable.com/google-links-onclick-javascript-25585.html)

  • When you say "So you'd want to specify the URL somewhere in there, or somewhere on the page that would make it clear to search engines what the intended link URL is" - what do you mean exactly? (Can I trouble you for an example?) – Sensei James Jun 1 '18 at 17:45
  • @SenseiJames It's hard for me to say, since I'm not familiar with Ionic or what the framework allows, but if you can somehow replace 'FaqsPage' with the full URL, or even use a title= attribute on the link and insert the full URL in there, it might help the crawlers identify the link address easily. – Henry Visotski Jun 1 '18 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.