Does replacing <a> with <span> cause problems in the page’s SEO?

Asked

Viewed 267 times

1

Well, I have this html to activate the title and article link:

<h1 class='post-title entry-title'>
    <b:if cond='data:post.link'> 
        <a expr:href='data:post.link'><data:post.title/></a> 
    <b:else/> 
    <b:if cond='data:post.url'> 
        <a expr:href='data:post.url'><data:post.title/></a> 
    <b:else/> 
        <data:post.title/> 
    </b:if> 
    </b:if>
</h1>

What I want to do is replace the <a> for <span> - see:

<h1 class="http://post-title entry-title"http://>
    <b:if cond="http://data:post.link"http://>
        <span expr:href="http://data:post.link"http://><data:post.title/></span>
    <b:else/>
    <b:if cond="http://data:post.url"http://>
        <span expr:href="http://data:post.url"http://><data:post.title/></span>
    <b:else/>
        <data:post.title/>
    </b:if>
    </b:if>
</h1>

When making this substitution, it will disable the click on the article title, but the link will remain visible to search engines.

This method is wrong, can harm the SEO of the page or no problems?

2 answers

3

It is wrong yes. This is not valid HTML, as the element span does not have the attribute href. I’m no SEO expert, but I’d say the chances of search engines ignoring your links are pretty high.

3

If what you want is to undo the action of the element <a> use javasctipt Event.preventDefault() and keep your HTML correct. The links are of utmost importance to get good SEO, but for a good quality page always try to use the elements for the functions for which they were created. Now if the link does not point to any important page on the site, then you can switch and you should switch. Don’t forget to take out the href attribute.

  • Olá @Manuel Gerardo Pereira, I had already seen this possibility to use javascript to undo this effect. My question was about the <span> tag (I’ve already been clarified)! I don’t think I’ll remove the link from the article - this modification was only for aesthetics! I wanted to leave the title of the articles of my blog, like the titles of the blog articles made in Wordpress. Thank you all for your clarifications.

  • @Pauloroberto If the question is aesthetic, you can "disguise" the link with CSS.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.