Site logo

Archived topic

"#main" at the end of every attachment URL

22 replies · Started by Vish on August 7, 2019

Viewing posts 16–23 of 23

hey,

having completely same problem, was transferring old site to GP and it added #more to the URL when viewed inside WP editor, while on actual URL added -1..

Example...
WP Editor: mysite.com/category/image-file-name/#more
Actual URL: mysite.com/category/image-file-name-1

As I still have old site I can see that there are pretty URL used for images.

Is there a quick fix for this as code above is not working?

Edit:
I can confirm that after adding code it's not adding more tag anymore, but now I'm left with thousands of images with added numbers on URLs, and from SEO perspective it's not quite a good idea to change all URLs, even with 301 redirects in place (which would take days to finish).

And quick fix to get my old URLs back?

Hi there,

WordPress will append numbers to URLs if the URL is already taken by another post/page/attachment. The theme itself doesn't do anything to URLs.

So if you already have a category/image-file-name and another one is added, it will be category/image-file-name-1.

Perhaps that's what's happening for you?

Well, possible, thing is that I manually copied all images via rsync, and then only imported posts, pages etc, but without attachments. Honestly have no idea how it happened, but still sub-folders to go so will try and see if it happens again.

Already fixing all those URL, via media replace plugin, it's fastest to go as I've decided to optimize images a bit more... so all good!

Will let you know if this will happen again.

thanks

Sounds good! :)

This is happening to me too, really a disaster, has there been a recent change in GP that is causing this. Regarding the reason for the addition of #main - my input is to get rid of it, period.

The theme itself doesn’t do anything to URLs as Tom mentioned.

You should get the same issue when testing with a twenty series WP theme.

where i add this php

This archived topic is closed to new replies.