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: |
|
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
@
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
#2
@
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.
#4
@
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
@
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.
Hi there, welcome to WordPress Trac! Thanks for the ticket.
Replying to masimoti:
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:
?name
parameter to the URL.