[ad_1]
I have a url that starts like this. www. example com/category/post/attachment/12345
Search engines always try to reach attachments. But I want to stop that. how can I do it? the attachments no longer exist.
I want every time www. example com/category/post/attachment/12345 is entered to www. example com/category/post/ is redirected
thanks.
[ad_2]
1. Add this to your robots.txt `Disallow: /category/post/*`
2. Log into GSC and perform a URL Removal request for URLs prefixed with /category/post/
3. Use an SEO plugin to prevent media attachments from being indexed (eg https://www.greengeeks.com/tutorials/set-wordpress-to-disable-attachment-pages-for-media/)