Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.76k stars 891 forks source link

Attachments not redirecting to parent pages #9316

Closed SukcesStrony closed 6 years ago

SukcesStrony commented 6 years ago

With one of the latest Yoast SEO versions (7.x), the attachment redirection function has changed, breaking some of the pages and not functioning as described in the Yoast Knowledge Base.

See this info: https://kb.yoast.com/kb/redirect-image-attachment-urls/

The options says “Redirect attachment URLs to the attachment itself?” and checking this box does exactly that.

Meanwhile, prior to Yoast 7.x (not sure which one exactly), the option basically was “Redirect attachment URLs to PARENT POSTS WHICH THEY ARE ATTACHED TO?”.

On the info page linked above, the description says: “Redirect will automatically redirect the attachment URLs to the parent post.” and there’s info on how to attach or detach attachment from posts.

This change in behaviour was therefore rather not intentional and is a bug. Further, websites which use image galleries to link to pages or posts which the attachments are attached to are now broken, as link point to images rather than posts.

Please correct this function so that it still redirects attachments to the parent posts which they are attached to.

In an ideal situation, users should have the following options: 1) Redirect attachment URLs to parent posts which they are attached to (on by default AND TURNED ON IF THE CURRENT AND PREVIOUS REDIRECTION SETTING WAS TURNED ON, for backwards compatibility) – use the function which was used in Yoast 6.x 2) Redirect attachment URLs to attachments themselves – use the function which was used in Yoast 7.x 3) Do not redirect attachment URLs

Interlinked with forum post: https://wordpress.org/support/topic/bug-attachments-not-redirecting-to-parent-pages/#post-10101803

Best, Chris

maureen5 commented 6 years ago

Our site is one of those affected by this latest Yoast upgrade, all my gallery page images not redirecting to post page of which there were 400 posts, have spent a week trying to find the problem with not a great deal of help from Yoast except offering to help and waiting for more than 24 hours for them to get back to you with not much help. The latest upgrade of Yoast if you can call it an upgrade, corrupted all of my meta descriptions on 400 pages, my sitemap redirected to the home page and Google Webmaster couldn't find them. As a paid member of Yoast this has been a very disappointing experience, especially with support which has come from three different people and almost robotic in reply, almost a week of downtime for my website.

SukcesStrony commented 6 years ago

As a temporary solution, turn off the "Redirect attachment URLs to the attachment itself?" option and use the following code in your functions.php file:


  add_action( 'template_redirect', 'sukcesstrony_attachment_url_redirect' );

  function sukcesstrony_attachment_url_redirect(){
    global $post;

    if ( is_attachment() && isset($post->post_parent) && is_numeric($post->post_parent) && ($post->post_parent != 0) ){
        wp_redirect( get_permalink( $post->post_parent ), 301 );
        wp_reset_postdata();
        exit();
    }

  }
Gf177 commented 6 years ago

Where do you recommend to put the code? At the bottom of the function.php file? Sorry, I don't know a lot about coding.

Also, on the wordpress forums another user said if the attachment media is posted in more than one blog post there is a redirect problem? Would that still exist or would it only redirect to the original or parent post, i.e. other blog posts could have the image, but they wouldn't be child of the parent or original post.

Sandzee commented 6 years ago

Thank you SukcesStrony! I have applied this filter too in my functions.php file and now the attachment URLs are redirecting to parent posts but for my own info kindly tell me that yoast recommends we should redirect attachment URLs to the attachment itself but when I do this, my attachment sitemap gives 404, not found error and they say media is set to no index. So, how it is possible that we set it to yes and even then our images are indexed?

SukcesStrony commented 6 years ago

@Gf177 Doesn't matter that much where you put this code. Top of the functions.php file will be fine. If you want to keep things tidy, use the "Code Snippets" plugin to paste such code. An attachment can be "attached" to only 1 page or post (selected in the Media menu). Using the same image file in 2 different posts or pages doesn't affect redirecting. What can be troublesome is when an attachement is not attached to any post or page - then the redirect obviously won't work. But that's not a bug and can be fixed by attaching the attachment in the Media section.

@Sandzee Yoast SEO probably detects that the attachment page URLs are redirected and so there's no point in making a sitemaps file for them, as they are redirected anyway. Be sure to understand that the attachment sitemaps are sitemaps for dynamically generated URLs like: domain.com/ATTACHMENT-FILE-NAME/ - this displays the attachment inside the theme (with the menu, sidebars, footers) and this is redirected and therefore not indexable domain.com/ATTACHMENT-FILE-NAME.EXTENSION - this is the exact URL of the file and is NOT redirected, and is indexable So, with the code above you're not redirecting the media file itself, just an URL which WP generates automatically for each media file.

Sandzee commented 6 years ago

ok thank you.

maureen5 commented 6 years ago

Thank you to Sukces Strony,

After more than three weeks hoping that the Yoast techies would help me solve the problem of images not being redirected to the post page and many emails to them regarding this issue, the code you have provided is perfect, images redirect to posts as they did before the 7.0 Yoast upgrade. Just wondering though, as you say it is a temporary solution, when Yoast brings out a new upgrade will this code still work?

Thank you so much,

On Fri, Mar 23, 2018 at 9:27 PM, SukcesStrony notifications@github.com wrote:

As a temporary solution, turn off the "Redirect attachment URLs to the attachment itself?" option and use the following code in your functions.php file:

add_action( 'template_redirect', 'sukcesstrony_attachment_url_redirect' );

function sukcesstrony_attachment_url_redirect(){ global $post;

if ( is_attachment() && isset($post->post_parent) && is_numeric($post->post_parent) && ($post->post_parent != 0) ){ wp_redirect( get_permalink( $post->post_parent ), 301 ); wp_reset_postdata(); exit(); }

}

}```

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Yoast/wordpress-seo/issues/9316#issuecomment-375629581, or mute the thread https://github.com/notifications/unsubscribe-auth/AKCdqi66MFbDxnMpPLwXX-k6odARj7Ueks5thNwzgaJpZM4S27eG .

SukcesStrony commented 6 years ago

@maureen5 One of the redirections (the one in the code above or the one introduced by Yoast) will take priority. Likely it will be the function run by Yoast as the one above has a default priority of 10.

michaelbriantina commented 6 years ago

Please inform the customer of conversation # 342030 when this conversation has been closed.

PatrickYoast commented 6 years ago

Please inform the customer of conversation # 344309 when this conversation has been closed.

Pcosta88 commented 6 years ago

Attachment Pages get redirected to the Image File itself:

Set Redirect

1

See Attachment Page

2

Click on image and instead of being redirected from the attachment page back to the main url it goes to the image file

3

This is as expected from v7.0: https://yoast.com/yoast-seo-7-0/

Pcosta88 commented 6 years ago

Please inform the customer of conversation # 357610 when this conversation has been closed.

niki333niki commented 6 years ago

On one of my sites, this bug somehow reindexed all the attachment pages, shooting tons of low quality content out onto Google, bringing down both search ranks and traffic overall by the time I figured out what the hell happened and manually fixed the problem. Please inform me when this is addressed.

FattyBull commented 6 years ago

I do have simply blog posts with featured image. I checked all settings and updated to the latest yoast version. The attachment re-direct does not work. All featured images are indexed with attachment pages. This is not good and a major bug.

Please help. This became a huge problem and simply irritates all users who trust the yoast brand over years. Thank you very much for all your help and fixing that problem! I really do appreciate it!

Rob-Rychs commented 6 years ago

Hey sort of half-relevant to this:

I have a few images that we changed the file name for OR the image has been deleted. Now those old image urls are returning 404s.

I've tried to add the old image url (with the .jpg extension) and redirect them to either the homepage or the newly named version of the image url using the latest version of Yoast's premium redirect manager but it doesn't seem to be working...

Any help would be appreciated!

jack2345A commented 6 years ago

@SukcesStrony I looked again at the solution and actually there are two issues here. Just redirecting pages may not be the best solution.

The big issue is that the pages are already indexed - you need to remove them ASAP. How to remove these pages from the Google index:

You'll need to mark them as NOINDEX. Otherwise they'll stay in the google index for a VERY long time. To do that - in the yoast plugin:

Redirect attachment URLs to the attachment itself? -> select NO Show Media in search results? -> select No [super IMPORTANT}

This will add a noindex to all media pages and Google will remove them from the index. If you'll redirect these pages Google will miss the noindex so you must NOT redirect them.

But here's the catch once you marked "Show Media in search results?" to be No. They will not be in the sitemap so potentially Google wouldn't bother touching them and will not see the no index.

You need to submit a sitemap with these pages and change the mod date.

See this on how to deindex page quickly: https://www.seoinc.com/seo-blog/fastest-way-to-deindex-pages/

See this related article: https://www.bloggingglobal.com/attachments-pages-redirection-not-solving-problem-search-results/

After you've verified that all media pages have been removed you can redirect them if you want. But the noindex will prevent them from appearing the Google index.

I need to be quite clear and say that I completely lost trust with the YOAST SEO plugin. My site was in great shape but that change resulted in 4,000 thin content pages submitted to Google index. I now need to clean up the mess that they did and recover from the Google penalty that it caused. No QA in Yoast? This is a massive loss in my side

FattyBull commented 6 years ago

So how in heaven can we fix that?

SukcesStrony commented 6 years ago

@jack2345A thanks, I've fixed it.

jdevalk commented 6 years ago

I'm sorry some people got the wrong setting here during the upgrade. I can understand people are annoyed, as we also really didn't want this to happen.

There's not much for us to fix though: just set the first setting to "Yes" on the Media tab and attachment URLs no longer exist. That should take care of the problem in no-time. We will add a notice in an upcoming release, asking people to re-check this setting specifically when it's set to "No".

jack2345A commented 6 years ago

@jdevalk - the advice that you give will put websites in more trouble,

You need to tell Google to NOINDEX these pages - they don’t need to be in the Google index. They need to get removed as fast as possible.

When setting to "Yes" the first setting Google will still keep these pages. There is really no point to redirect Google to the images as it serves no purpose and just loading the Google index with thin content as the images are already on the parent page. Google is smart enough to extract the images.

I am still at a loss why you made this change - this absolutely destroyed Google traffic. There was nothing wrong with the previous way that this was handled. It worked great for many years.

You obviously know that recovering from Google penalty is not a matter of "no-time". It may take months. Also many of these pages are orphaned pages so you really need to tell Google that something has changed by changing moddate in the sitemap.

Is anyone in the Yoast team really know what they are doing - this is such a basic error in your side. There is really no need in having these media pages in the Google Index. You are destroying the livelihood of hard working website owners.

FattyBull commented 6 years ago

I agree with Jack.

So what’s the status on that issue? I am still confused 🤷‍♂️?

If we set it to “YES”, the media attachments will be still indexed as independent pages?

@yoast: Can you please clarify what the heck is going on here and can you be absolutely clear about necessary steps?

Appreciate it!

maureen5 commented 6 years ago

This problem happened with my web site, tried to solve it myself, then tried to solve it through Yoast support following all their recommendations, this went on for two weeks, very disappointed in Yaost to say the least, they did however give me a month extra on my account , which really doesn't compensate for two weeks of lost time and work trying to solve the problem + Google problems.

Anyway for those who still have the problem a tech person from GitHub gave me the code below to add to functions.php which solved the problem - although this is a workaround, I don't know if another update by Yoast is going to upset the apple cart so to speak.

Hope this is helpful. Maureen

add_action( 'template_redirect', 'sukcesstrony_attachment_url_redirect' ); function sukcesstrony_attachment_url_redirect(){ global $post; if ( is_attachment() && isset($post->post_parent) && is_numeric($post->post_parent) && ($post->post_parent != 0) ){ wp_redirect( get_permalink( $post->post_parent ), 301 ); wp_reset_postdata(); exit(); }

On Sat, May 26, 2018 at 9:49 AM remozseo notifications@github.com wrote:

I agree with Jack.

So what’s the status on that issue? I am still confused 🤷‍♂️?

If we set it to “YES”, the media attachments will be still indexed as independent pages?

@Yoast https://github.com/Yoast: Can you please clarify what the heck is going on here and can you be absolutely clear about necessary steps?

Appreciate it!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Yoast/wordpress-seo/issues/9316#issuecomment-392215422, or mute the thread https://github.com/notifications/unsubscribe-auth/AKCdqlKgYZOgHWYa7-HNvMXGC093faWBks5t2JhsgaJpZM4S27eG .

jack2345A commented 6 years ago

@remozseo

See this article: about the Yoast SEO

It describes How Yoast SEO plugin for Wordpress will get you into Panda penalty by Google What to do to recover What to do with the Yoast SEO

https://www.seoblog.com/2018/04/wordpress-attachment-hurt-seo/

jdevalk commented 6 years ago

If you set the first setting on that page to Yes, ALL attachment pages are redirected. They no longer exist.

You can indeed also choose to set it to No, and then to noindex, but in the long run, the first solution is really the best.

krunccrni commented 6 years ago

I set it to yes, but that pages are still showing in google index, it only redirect to picture. It was not like that before the update. Can you please tell me what to do to have the same amount of indexed pages like before the update?

jdevalk commented 6 years ago

The behavior changed, it now redirects to the image, not to the parent page. That's intended. It'll take some time for Google to reflect those changes.

The total number of indexed pages will drop, as the images do not count as indexed pages in google search console.

krunccrni commented 6 years ago

ok, thanks!

FattyBull commented 6 years ago

@yoast: with “Yes” it’s intended to direct to the image and not the page anymore?

How come? How is that beneficial for google? Why that change?

I guess the majority of us is just confused and we don’t understand why you changed it and how it will or should help with the rankings?

Why did you change it?

Could you please explain?

Thank you so much, appreciate it!

jdevalk commented 6 years ago

The rationale was simple: not all attachment pages have a parent post. Images you upload to your media library and don't attach to a post, for instance when you use them as header images, or in the customizer, or in lots and lots of other ways, don't have a parent. So all those attachment URLs couldn't redirect anywhere, didn't do anything, and therefore did still exist.

Next to that, if you use an image twice, it would redirect to the post it was connected to, regardless of where Google found the link. That's weird behavior.

To make the behavior simpler, faster and more reliable, redirecting to the image made much more sense. In general, you should not link to your attachment URLs. There's no real reason to. The important thing on that page is... The attachment. So redirecting the URL to the attachment made more sense.

SukcesStrony commented 6 years ago

I think that having all 3 options which I listed in the 1st post is best and doesn't break people's websites. One can easily use the built in WP gallery with redirecting attachments to parent posts, while keeping tabs on attachments, to make a gallery which has links to individual pages.

Could you implement the 3 options which I wrote about?

jdevalk commented 6 years ago

I could, but I won't, because I think 1 is not necessary. We already have 2 and 3: if you set it to no, we don't redirect. If you set it to yes, we redirect to the attachment. Adding more options than that is only confusing and let's be fair: this is really not something the majority of our 8 million users should be thinking about longer than 10 seconds or so. If you use attachment pages, you need this to be set to "no", otherwise, "yes" is perfect and adding more code to do a third option only slows everything down.

HANNS22 commented 6 years ago

sir with this change your broken people business How Working hard year long to get some traffic . after this new yoast seo plugin my website down for many keyword at position 3 to 15. what was problem with older version? every bad have option to check NOINDEX attachment ! you are Know this was big mistake but they want to show are not incorrect !

you don't want to people lose faith in this yoast plugin . I think there are thousands of bloggers who think so like me and looking for alternative

jdevalk commented 6 years ago

@hanns22: i'm sorry you've suffered from this, i truly am, but there's not much we can do now, and the new solution is truly better.

FattyBull commented 6 years ago

hmm.. ok.. so the conclusion to all this confusion is: Keep the settings to "YES", as it was before when using "YES" to re-direct to the attachment pages, correct?

jack2345A commented 6 years ago

@HANNS22, @remozseo If you want to get (or keep) the Panda penalty feel free follow the advice of @jdevalk

But if you want to recover / avoid Panda - deindex these pages as fast as possible - this what I am doing now. It's a painful and long process. The Yoast SEO plugin caused a HUGE damage to my site.

After you deindex all pages - use the redirect code so that the attachment pages will get redirected to the parent post. NOT to the image as the image is already in Google (extracted form the post)

P.s if you decide to deindex make sure to submit a site map with a changed modedate. Once you set the Yoast plugin to noindex these pages - the sitemap will disappear which is terrible if these page are already in the Google index.

You'll need to wait at least 2-3 week until the pages are gone.

I suspect that there are thousands of sites (or even MUCH more) that got Panada penalty because of the changes in the Yoast SEO plugin. I've seen lots of comments in sites such as SEO Journal and in forums. People don't even know what hit them or why it happened. They don't really associate an upgrade in the Yoast SEO plugin to Panda penalty.

I'll drop this plugin as soon as possible.

image

FattyBull commented 6 years ago

@jack2345A: I see your point. I don't understand why Yoasts comments are totally the opposite?

@jdevalk: I am really sorry yoast. Somehow your explanation does not make sense. If the settings are set to "YES", it means that the attachment pages are linking to the empty pictures. Therefore, a bunch of pictures will be indexed as pages.

But the problem is, those pages are not pages with any content on it. Those pages are basically blank pages with an image.

Can you explain why it should make sense to index a bunch of empty pages, with images on it? It doesn't make any logical sense. And I do agree, following ack2345A comments.

You wrote and explained, if you are using attachment pages you need to set it to no. Well, isn't WordPress automatically creating attachment pages?

Is it really as complicated to write ONE CLEAR BLOG POST ABOUT THIS WHOLE CHAPTER? A step by step statement, clear explanation, why you think your update should be fine as it is?

It is still unclear for a rookie WordPress user like me. When using your plugin, do you recommend now having those settings to YES, or to NO?

Thank you for taking the time and explaining it. I guess a Video Tutorial + Statement would be even the best, considering you have 8 Million users.

Thank you for your efforts, appreciate it!

jack2345A commented 6 years ago

@remozseo - reason is simple. Yoast invested lots of resources in making these changes in the plugin. And he is not going to revert them and cause more issues. This is his decision - take it or leave it.

The yoast SEO plugin is not the "god" of SEO - it's merely another tool in your toolbox that you can use. It doesn't really transform your site - it just makes your life simpler.

At the end of the day it's your site.

To me it doesn't make sense to have these pages as they don't add any value. If it's not adding value - why have it in the google index?? Why have thousands of indexed pages that don't add any value?

Yoast thinks differently but he doesn't own my site. And I sure not going to take his word after his changes put my site into Panda penalty.

krunccrni commented 6 years ago

up he wrote "The total number of indexed pages will drop, as the images do not count as indexed pages in google search console." so I did set this option to yes, and already almost 200 pages are gone from google search results. Hope this works as I also saw a drop in traffic.

jack2345A commented 6 years ago

@krunccrni - the general issue with that approach is that you are still submitting to the Google index pages that shouldn't be there (even if they get redirected to images).

Google's behavior today is to say something like: "I can see that you've submitted a page which is redirected it to image - I'll just mark this as an image and remove it from the index"

In the future Google may say: "you are submitting tons of junk I'll just put a penalty on your site"

My approach is - why take a chance. These links are not helpful and as such shouldn't be indexed in any form. I am also not going to take a chance with Yoast SEO plugin - in the future one of their programmers may make a mistake and disable this redirection to image. Or someone in the Yoast team may suddenly decide that "things should be changed" and you are back to square one.

FattyBull commented 6 years ago

@jack2345A indeed, that makes sense. I hear you. The questions is: How can you make sure, that the attachment pages from WordPress (which obviously have zero value and just contain images) aren't getting indexed by google?

How can you avoid it when using WordPress?

jack2345A commented 6 years ago

@remozseo - this is simple: Mark the attachment pages in Yoast as noindex but DON'T redirect to Image. (Also important to remove existing pages).

After you have all these pages out of the Google index, use the code the suggested by @SukcesStrony to redirect the attachments page to parent page.

Once you have the attachment pages as noindex - Yoast SEO will not generate sitemaps for them so Google will not know about them.

Assuming something will break in Yoast SEO - in the future you have the redirection to parent post hard coded (as a safety net outside of Yoast). So if Yoast decides to tell Google to index the attachment pages - they'll get redirected to the post which will not change anything.

I am also reminding myself to regularly check Google console for any change in the number of indexed pages and look at any spikes.

Essentially I am trying to mitigate any future bug / changes in the Yoast plugin. (I just lost trust in this plugin).

It is very much aligned with what this person suggests: https://www.seoblog.com/2018/04/wordpress-attachment-hurt-seo/

FattyBull commented 6 years ago

@jack2345A this is super interesting. Also thank you so much for all your explanation.

I am still a newbie to WordPress. I tried to google it, but I was not able to find any clear answer to that. How in heaven, can you find all your attachment pages?

I tried to search within the MEDIA-TAB. But all I can find are MEDIA files, unattached. image

Are the unattached media files the one we should attach to a page? So yes... I have no clue how to find all attachment pages... lol;

Uff.... I guess I do have a total black out right now. Totally confused. Is there anywhere a simply step by step guide I could follow?

Thank you so much for all your help folks - you rock - cheers!

jdevalk commented 6 years ago

We're working on a post about this topic and a better solution to get rid off attachment URLs in the search results, if you're truly suffering from it. Lots of moving parts but we're working as fast as we can.

pirlusa commented 6 years ago

Hi, I´m not an expert in these things and it took me a while to realise it was a problem caused by Yoast plugin and not by myself. I´m going to uninstall Yoast because I couldn´t figure out what was happening, and unless I become a programmer I´ll never do that fast enough to avoid a problem in my site. The first notice I had was a +453% in bounce rate, IN A WEEK. I assumed I was writing content that people found irrelevant. Haha. I googled my site and guess what, instead of my post people was redirected to A BLANK PAGE WITH JUST AN IMAGE. Not a 100% irrelevant one, but it was an image supossed to be within the blog content, they are meant to work adding info to your post. They can´t BE informative without a post, they don´t stand alone. I don´t know who had the idea of "hey, we don´t know where to redirect this image because it´s attached to 2 posts, let´s make it redirect to itself" WTF people!! And since a developer in this thread admitted to think it was ok...I´m pretty astonished. The multiple attachment was not my issue since I had certain images for certain posts. But the logical option is to redirect them to 1) all the parent posts to which they are attached, ordering them by relevance / matching with the user search. (the best one IMHO) 2) the parent post it was first attached, or the last one, aka, more recent parent post or first parent post with that image attached (a dated sort of choice) 3) NO INDEX. Please, don´t index them at all!!! I´m now de-indexing each one manually with URL removal tool in Search Console. I´ve already marked them as Noindex, I´ve submitted a new sitemap without those URLs, I´ve changed the default image-url-link with "none" in wordpress, I´m planning to write that code given in this thread (thanks guys!) in my ftp (a task that FREAKS ME OUT since I repeat I´m not a code reader, less a writer, even a copypaster!) but you know what, those infame blank pages are still showing in my search results. Yoast messed up totally the way my blog appears in Google, it doesn´t show the snippet under the posts, just unrelated tags or portion of texts, and searching only my blog (without keywords) throws obsolete tags below (I´ve deleted them once month ago). And I always had the option "Show tags" disabled!! Now it turned to show obsolete categories AND obsolete tags. A disaster!! Even if I selected no-index in each one. I´m still trying to figure out what I should do to appear fine as before Yoast got installed in my Wordpress, an action I truly regret. A friend of mine says it goes to a blank page when he googles my site (he has Opera browser in his phone) and I suspect it´s because somehow the image pattern of my theme is getting indexed or something as crazy as that is happening. All of these issues were non existent before. I don´t know if everything is due to Yoast, but this mess is bad enough. Besides that, the SEO optimization is just giving the author certain recommendations (where to put a keyword, how many times it should appear, etc), I´ll write those recommendations down and use the old and tested Word count tool in a word document instead of jeopardizing my site, my traffic, my Google appearance, and my hosting resources!! Sorry but you shouldn´t mess up with Google guys, most of (if not all) our income as bloggers comes from Adsense. I guess I´m lucky for not being punished by Google just by a prior and non advisable thing I did: instead of attaching images in Wordpress library, I used to just embed a link from my Instagram profile in my wordpress posts. That way my site was extremely low and each post weighted 15 MB, but I avoided the magic creation by WP and indexation by Yoast of hundreds of thin content pages. Also I used to "hotlink" my own images from my own old Blogger blog, I don´t know if it is a good practice, but since I´m the owner of both domains and Google is informed about that, it isn´t punishing me (unless it is and I´m not aware). Sorry my English and my non programming language, I barely understand these things and I had to learn as much as I could in 2 days. I´ll welcome any advice!

sanderkie commented 6 years ago

I have set my Media redirect to YES.

As a result, the first 5 results in google are IMAGES. The product page is actually pushed down to second page, no mans land.

Apparently now google thinks the 5 page images are more important than the product page itself, completely destroying any SEO results as everybody clicks away the attachment page.


We can now start doing all kinds of things. Like making them NOINDEX or start redirecting all the images manually. YoastSEO is taking too long to come up with a proper solution. What would you suggest doing in the meantime? The temp solution might do more harm then good.

bnc8 commented 6 years ago

I've gone with the workaround mentioned by @jack2345A referencing this post: https://www.seoblog.com/2018/04/wordpress-attachment-hurt-seo/, using method 4.

I'll give Yoast a chance but agree this was a bit of a shocker and has cost me and my client a lot of money, frustration and rankings trying to work it out, and am concerned something like this will hurt it again in future.

Seems a simple thing for Yoast to do what method 4 does, to check the scenarios it mentions in https://www.seoblog.com/2018/04/wordpress-attachment-hurt-seo/.

jack2345A commented 6 years ago

Hi @bc1974A - just make sure that Google removes the pages first before you do the redirect. (at least this is the recommendation). If it's just a small number of URL's the quickest option would be to use Google console to Remove the URL. The issue that I found is that Google is really slow in crawling these pages again and removing them. These are low value pages and Google doesn't spend resources on that. Really hard to wait when traffic has plummeted. I still think that these URL's shouldn't be in the Google index (even no redirect to image)

sanderkie commented 6 years ago

A final recommendation by the YOAST team would be highly appreciated.

jack2345A commented 6 years ago

Hi @sanderkie - Yoast released his "purge" plugin. Strictly speaking it doesn't purge anything from the Google index. It just marks the attachment pages with 404 and submit sitemap to Google. But Google will decide according to its own schedule when to remove these pages. You'll notice that Yoast says that you need to have this plugin installed for a few months.

So not really a purge - it's just tells Google that the pages are gone.

If you want a quick purge just use the Remove URL from your Console.

sanderkie commented 6 years ago

Thank you for the heads up @jack2345A . I would appreciate it of @jdevalk would comment on this and the right steps to take.

As a wrong step might take many months to correct (as we can see now); I would rather do it in align with Yoast. Otherwhise we might need to move towards a different SEO approach as Yoast lost a lot of credibility with this move.

Joost, could you share your thoughts?