Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#56312 reopened defect (bug)

Appending ?name to home URL shows the posts page instead of a static front page

Reported by: masimoti's profile masimoti Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Query Keywords: needs-patch
Focuses: Cc:

Description

I found something strange
I installed a WordPress then from setting . Reading I set a sample page as homepage
And when I opened website it was ok and showed content of sample page but when I added query string “?name” it showed latest blog posts
I tried everything as query string nothing did that and all showed sample page content and that was ok
Just just with ?name query string showed different thing
For ex localhost/site/?name show latest posts but
Localhost/site/?everythingyoutype
Was ok and show content of the page
Why ?name query string is like that??? I want to remove it

actually you must test it just on homepage of your site
not another pages
it hurts SEO if you show something else with query string on your site (specially on your homepage) instead of the main content
basically as you said when you enter the url of homepage with /?name you should see the homepage and nothing should change because it’s just a query string
I can show you an example
see this : https://amepro.at/
as you see everything is fine and homepage of website is ok
but please see this one https://amepro.at/?name
here you see the blog posts and it hurts SEO very bad
I got too much errors on search console with these kind of urls

Can you explan the logic behind it why should we show another thing like latest post when someone enter some parameter ?
it’s not normal at all

Change History (6)

#1 in reply to: ↑ description @SergeyBiryukov
3 years ago

  • Component changed from General to Query
  • Keywords needs-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from WordPress bug with rewrite rule to Appending ?name to home URL shows the posts page instead of a static front page

Hi there, welcome to WordPress Trac! Thanks for the ticket.

Replying to masimoti:

Can you explan the logic behind it why should we show another thing like latest post when someone enter some parameter ?

I suspect this is because name is one of the reserved terms in WordPress, which specifically refers to a post slug, and since a post with an empty slug cannot be found, the query defaults to the posts page.

This sounds like an issue we should be able to fix. I was able to reproduce it on a clean install:

  1. On Reading Settings screen, assign a static front page and a posts page.
  2. Go to the home URL and check that the static front page is displayed.
  3. Append the ?name parameter to the URL.
  4. Now the posts page is displayed instead of the static front page.
Last edited 3 years ago by SergeyBiryukov (previous) (diff)

#2 @sajjad67
3 years ago

Hi @masimoti

Welcome to WordPress Trac! I was also able to reproduce it on a clean install. I will look into it for a possible solution. Not for this only we will have to apply the solution for all reserved words.

#3 @masimoti
3 years ago

thank you I'm wainting for a standard solution because it is an issue

#4 @ramon fincken
2 years ago

  • Keywords close added; needs-patch needs-unit-tests removed
  • Resolution set to wontfix
  • Status changed from new to closed
  • Type changed from defect (bug) to feature request

Why would you like to add "name" as parameter ?
As it is a reserved term it cannot be replaced as explained by @SergeyBiryukov

If this bothers you, you might want to switch to another variable get parameter name.

If it really bothers you, you need to completely rewrite WP Core for your personal use (case), which is absolutely fine, but you will need constant and heavy patching for new security and feature updates. I would not recommend you doing the latter as ( if you succeed ) will probably end you with an outdated and modified version of WP Core.

So .. my 2 cents .. go with option one.

#5 @desrosj
2 years ago

  • Keywords needs-patch added; close removed
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Type changed from feature request to defect (bug)

This sounds like an issue we should be able to fix. I was able to reproduce it on a clean install

Reopening this as there's still some discussion that can be had. It seems reasonable to display the preferred front page experience (blog posts or static front page) when an invalid name parameter is provided.

#6 @ramon fincken
2 years ago

That is absolutely fine.

I would still argue that this is (however reproducable) not an issue that needs our (highest) attention.

Note: See TracTickets for help on using tickets.