I have very unusual issue on my WordPress
website. In most of the blog posts custom permalink is working but there are few posts which are not following permalink structure like following
This is the correct link structure to open the blog post : https://www.knexusgroup.com/show/blog/how-to-win-at-real-time-marketing/
But you can access this blog post like following URL also : https://www.knexusgroup.com/how-to-win-at-real-time-marketing/
Blog posts which are correct, when you remove /show/blog/
from URL it will reflect 404 error, but in this blog post, it is opening the blog post.
Can anyone help me here to understand the issue & how to resolve this?
Edit 1
I have found what is the problem, and is post attachment & post have same post_name
. However this should be resolved by solution How to delete the permalink (landing pages) of image in the media library in Wordpress?
But this is not working in this scenario. We are using permalink structure /show/blog/%postname%/
and I've observed which posts have permalink structure, there is no edit option in media attachment.
With idea of comment, I and Jaswant came to know attachment have same post-name
as parent post
.
So we deleted attachment
of that post by searching in media library, and re added attachment to post, it works, this also fixed permalink of attachment with custom permalink and parent post.
I found all duplicate URL by running MySQL query.