Make WordPress Core

Opened 7 weeks ago

Closed 3 weeks ago

#62668 closed defect (bug) (duplicate)

Permalink Conflict Between Posts and Pages with Identical Titles in WordPress

Reported by: akshat2802's profile akshat2802 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: has-testing-info
Focuses: Cc:

Description

Permalink setting: Post Name

On publishing a page and post with the same title there is an override with permalink. And the latter one created renders on clicking 'view'.

For Example:
We create a post having the title 'Sample one'
Then we create a page having the title 'Sample one'

Then the permalink for both will be the same 'https://yoursite.com/sample-one'

And it will render content of Sample one Page every time.

Attachments (1)

62668.mp4 (1.2 MB) - added by parthvataliya 7 weeks ago.

Download all attachments as: .zip

Change History (4)

#1 @swissspidy
7 weeks ago

  • Component changed from General to Permalinks

#2 @parthvataliya
7 weeks ago

  • Keywords has-testing-info added

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.26
  • Server: nginx/1.27.3
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.26)
  • Browser: Chrome 131.0.0.0
  • OS: Linux
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Error condition occurs (reproduced).

Additional Notes

  • This issue is reproduced when the permalink structure is set to Post name.

@parthvataliya
7 weeks ago

#3 @kadiwala
3 weeks ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #13459.

Hi @akshat2802

This issue occurs because both posts and pages can share the same slug (permalink). However, WordPress uses a priority system to determine which content to display when accessing a URL with a common slug.

By default, WordPress prioritizes pages over posts. So, when you create a page with the same title (and therefore the same permalink) as a post, the page's content will be shown because it takes precedence over the post.

Note: See TracTickets for help on using tickets.