WordPress.org

Make WordPress Core

#24825 closed enhancement (wontfix)

Print wp_no_robots only once

Reported by: tivnet Owned by:
Milestone: Priority: normal
Severity: trivial Version:
Component: Template Keywords: has-patch
Focuses: Cc:

Description

This patch will not allow printing meta robots tag more than once (if called by different plugins).

P.S.
I'd think about a more universal method, wp_meta_robots({parameters}), which every developer should use. Or something in the lines of "wp_register / wp_enqueue" - for all meta tags.

Attachments (2)

wp_no_robots.patch (459 bytes) - added by tivnet 20 months ago.
24825.diff (493 bytes) - added by wonderboymusic 18 months ago.

Download all attachments as: .zip

Change History (9)

@tivnet20 months ago

comment:1 @tivnet19 months ago

  • Type changed from enhancement to defect (bug)
  • Version 3.6 deleted

Could you please make any resolution on this?
Thank you!

comment:2 follow-up: @SergeyBiryukov19 months ago

  • Milestone changed from Awaiting Review to 3.7

@wonderboymusic18 months ago

comment:3 @wonderboymusic18 months ago

  • Milestone changed from 3.7 to Future Release
  • Type changed from defect (bug) to enhancement

This is a utility function - it's not a bug if it is called more than once.

comment:4 in reply to: ↑ 2 ; follow-up: @tivnet18 months ago

Replying to SergeyBiryukov:

Sergey, this change is so obvious (to me) and so tiny - yet it stays here for 2 months? This meta must not be printed more than once.

comment:5 in reply to: ↑ 4 ; follow-up: @nacin18 months ago

Replying to tivnet:

Replying to SergeyBiryukov:

Sergey, this change is so obvious (to me) and so tiny - yet it stays here for 2 months? This meta must not be printed more than once.

That's what I'm curious about. Why must it not be printed more than once? Do search engines ignore it all together? Does the page not validate? Does the browser refuse to load the page?

This isn't necessarily a utility function. It should be attached to wp_head. It can be used with add_action() repeatedly and it'll still only be printed once.

comment:6 in reply to: ↑ 5 @tivnet18 months ago

Replying to nacin:
You know, you are right it really does not matter. There should be a good function that collects and prints meta tags all together, with all possible options, and without duplication. As it is now - it's better just not to use in own development, and leave it for the core internal use.

Let's scratch this ticket.

comment:7 @SergeyBiryukov18 months ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.