Naturally, when one attaches images to WordPress pages or posts, these images are duplicated into their very own webpages; These automatically created attachment pages can then be indexed via search engines like Google, and then mislead people to visit them, instead to their ancestor page that is text based.
How can one prevent this problem from ahead when creating a brand new site? What should be changed in the settings to make sure that this phenomenon won't happen / No image page will be created when images are attached to pages posts?
Edit:
I would prefer a way without using 301 redirects, but such desire might be problematic as the WordPress source code would be updated each time anew, and the customization that prevents the formation of attachment-pages will be deleted.
Naturally, when one attaches images to WordPress pages or posts, these images are duplicated into their very own webpages; These automatically created attachment pages can then be indexed via search engines like Google, and then mislead people to visit them, instead to their ancestor page that is text based.
How can one prevent this problem from ahead when creating a brand new site? What should be changed in the settings to make sure that this phenomenon won't happen / No image page will be created when images are attached to pages posts?
Edit:
I would prefer a way without using 301 redirects, but such desire might be problematic as the WordPress source code would be updated each time anew, and the customization that prevents the formation of attachment-pages will be deleted.
Share Improve this question edited Jan 25, 2020 at 12:18 asked Dec 4, 2016 at 19:06 user87795user877951 Answer
Reset to default 0Attachment posts aren't exactly the worst thing in the world. They increase the size of your site, and can contain relevant data if you're using alt, description and title tags. HOWEVER, I do completely see your point, but the good news is that Google won't crawl those pages if they're not linked anywhere or included in your XML sitemap.
Here's a WP Beginner's tutorial from a few years ago. I'm a little reluctant to send you there because it references kind of old plugins, but the one note they make is to auto-forward all attempts at accessing your attachment posts by putting
<?php wp_redirect(get_permalink($post->post_parent)); ?>
in your first line of image.php for images specifically, or, I think what might be more global would be attachment.php.
Also, I just checked if the Attachment Pages Redirect plugin they reference is still being kept up, and, as of 4 weeks ago, it is, so that's another alternative.
Otherwise, I'd be on the side of leaving it alone, it's turned on by default for a reason. Mind you, that could change, but the few articles I've read say that there is the chance that keeping them open increases your SEO (but who really knows).
Anyway, good luck!
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744805742a4594765.html
评论列表(0条)