Make WordPress Core

Opened 20 months ago

Closed 20 months ago

Last modified 15 months ago

#62668 closed defect (bug) (duplicate)

Permalink Conflict Between Posts and Pages with Identical Titles in WordPress

Reported by: akshat2802 Owned by:
Priority: normal Milestone:
Component: Permalinks Version:
Severity: normal Keywords: has-test-info
Cc: Focuses:

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 20 months ago.

Download all attachments as: .zip

Change History (6)

#1 @swissspidy
20 months ago

  • Component GeneralPermalinks

#2 @parthvataliya
20 months 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
20 months ago

#3 @kadiwala
20 months ago

  • Resolutionduplicate
  • Status newclosed

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.

#4 @desrosj
18 months ago

  • Milestone Awaiting Review

#5 @wordpressdotorg
15 months ago

  • Keywords has-test-info added; has-testing-info removed
Note: See TracTickets for help on using tickets.