Technical Question: Affect of certain changes on index.php (Wordpress) on SEO

4 replies
  • SEO
  • |
I'll try to make this as simple as possible:

I added this little piece of code to the index.php on one of my WordPress-based sites:

<?php
$sticky = get_option( 'sticky_posts' );
query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1, 'orderby' => ID, 'showposts' => 2 ) );
?>


The reason I added this code was, I had a sticky post which I wanted to be displayed on the homepage all the time. And I set options to show only 1 blog post on the frontpage. And I wanted that 1 post to be the sticky post.

But what happened was, it displayed the sticky post as well as a recent post I wrote.

So when I set the options to show only 1 post, it didn't take the sticky post into account.

And that's why I added the code shown above.

Now it does exactly what I wanted: It shows only the sticky post on the frontpage.

BUT

Because of that code, what it does is.... even if I try to visit the single post page of any other post (besides the sticky post).... it still shows the sticky post!

So for example if I hit: MyDomain(dot)com/mylatestpost

It will not show the "mylatestpost".... instead it will grab the sticky post and show that.

So if there are lets say 100 posts, all those posts pages will show the same sticky post rather than the relevant post itself.

I hope this makes sense.

So my question is: Will this affect the SEO of my site? Will Google consider it as duplicate content?

Thanks for reading!

Regards,
Osman
#affect #indexphp #question #seo #technical #wordpress
  • Profile picture of the author rooze
    Yes it's a problem but not a serious one. If you think about it, you have plugins which appear on every page, a footer etc. So it shouldn't be a major issue.
    But why do it this way? Why not create a static page and have that as your home page (Settings - Reading - select a static home page).
    {{ DiscussionBoard.errors[5656093].message }}
  • Profile picture of the author Osman Safdar
    Thanks for the reply rooze.

    Yeah I guess are right. It's a lot easier just to create a static page.

    Don't know why, but initially I thought that doing it the sticky-post way would be easier! Just make a post sticky and set 1 post to show on frontpage and thats it!

    But then again, I was wondering... there could be some hidden benefit doing it the sticky post way...

    Lets say we do it the sticky-post way. Now lets say we have over 100 hundred articles on our blog all spinned from a couple of unique articles. Now the purpose of these 100 hundreds articles is just to increase the SEO value of the blog. I don't want the visitors to actually read those spun articles, i want them to read the one highly converting article i have on frontpage, every time they visit my site.

    I think the sticky post code accomplishes that..

    And then if we take this a step further...

    Suppose I take one spun article and optimize it for a long-tail keyword. Now when this spun article ranks on Google for this long-tail keyword.... will Google search results display the title and meta description of this article.... or the sticky post?

    Thanks for reading all the way till here! Appreciate your responses

    Osman
    {{ DiscussionBoard.errors[5658791].message }}
  • Profile picture of the author Osman Safdar
    Update: Just tested it with Google Spider simulator... and got my answers

    Thanks
    {{ DiscussionBoard.errors[5660440].message }}
  • Profile picture of the author Istvan Horvath
    Now lets say we have over 100 hundred articles on our blog all spinned from a couple of unique articles. Now the purpose of these 100 hundreds articles is just to increase the spam on the web.
    Corrected it for you!

    1. Learn the tool you are using: > Template Hierarchy « WordPress Codex
    (hint: home.php for what you wanted initially)

    2. SEO questions go to the SEO forum, not here!
    Signature

    {{ DiscussionBoard.errors[5661238].message }}

Trending Topics