Make WordPress Core

Opened 12 years ago

Closed 5 months ago

Last modified 8 weeks ago

#27494 closed defect (bug) (worksforme)

Posts page appears into search results

Reported by: sgr33n's profile SGr33n Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8.1
Component: Posts, Post Types Keywords: dev-feedback needs-patch 2nd-opinion close
Focuses: Cc:

Description

Hi,

if you set a static home page, so then a page for posts, this page is just a virtual page, because it doesn't have any content, just the title. But, if you search on the site for this title, the virtual page will be shown as search result. In my opinion this should be hidden.

Change History (9)

#1 @MikeHansenMe
12 years ago

I was able to confirm this. I created a page with the title "customtitle" then added some content to the content area(this would not show if set as posts page). Then I did a search for "customtitle" and it showed in the search results with the excerpt from the content area. This could however be desirable for example if the title was "News" and the content said something like check out all our news articles. Unsure if this is expected or a bug.

#2 @DrewAPicture
11 years ago

  • Keywords dev-feedback added

I think this is relatively valid point, that perhaps the page set for page_on_front should be excluded from search results.

#3 @DrewAPicture
11 years ago

  • Component changed from General to Posts, Post Types

#4 @swissspidy
9 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

#5 @Howdy_McGee
6 years ago

  • Keywords 2nd-opinion added

I think at this point flat out hiding the Posts Page and Front Page from search may be unexpected to most users. Adding a get_content filter for some kind of default content may be a better solution. A simple snippet such as:

Posts archive.

#6 @garrett-eclipse
6 years ago

  • Keywords close added

I agree hiding it all together isn't ideal. Although many themes don't support post_content on the posts_page doesn't mean all don't. On many builds I've done we use post_content as an intro to our blog or news section. As well if searching for 'News' or 'Blog' it would make sense to provide a link in the search to those pages as it's what the use was searching for.
*This almost feels more customization territory than core to me as you can update the wp_query through filters to suppress special pages from the results.

#7 @mindctrl
6 months ago

Hi all,

There's no consensus on whether this should happen, as it could affect sites that expect the current behavior. The example use case of searching for "News" makes a lot of sense to me.

It's been 11 years since this was opened and 5 years since this was proposed for closure. Thoughts on closing this one out to help clean up Trac?

#8 @callumbw95
5 months ago

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

Hi All,

As this ticket has been sitting for 5 years now with the close tag added, I think it is safe to assume we can close this ticket, however if there is further conversation to be had please reopen it. 😃

#9 @swissspidy
8 weeks ago

  • Milestone Future Release deleted

Removing milestone from closed ticket.

Note: See TracTickets for help on using tickets.