How to prevent WordPress Creating Separate URL for Images
Have you noticed your WordPress website or blog creating separate URL for images?
It creates unnecessary pages which Google crawls it.
Example:
- Post: example.com/blog/my-blog-post/
- Image URL: example.com/blog/my-blog-post/blog-image/
- Image Path: example.com/blog/wp-content/uploads/date/blog-image.png
Generally, there is no use of 2nd URL, it just creates unnecessary pages. Ideally, this should redirect to the image itself.
Here is ho to fix this.
How to set up WordPress not to create separate pages for images?
Step1: Go to WP Admin Yoast Search Appearance
WP Admin >> Yoast >> Search Appearance
Step 2: Go to the Media Section
Step 3:
Change Yes to “Redirect attachment URLs to the attachment itself”