Skip to content

[Bug]: Fix documentation for the wpseo_sitemap_entry filter #23148

@afercia

Description

@afercia

Prerequisites

  • I've read and understood the contribution guidelines.
  • I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened

See here:

* Filter URL entry before it gets added to the sitemap.
*
* @param array $url Array of URL parts.
* @param string $type URL type.
* @param object $post Data object for the URL.

Those params documentation appears to be wrong,

  • $url is not an Array of URL parts, as it actually contains other values. The shape is, for example:
^ array:5 [▼
  "loc" => "https://yoast.test/accessibility-trends/"
  "mod" => "2025-10-09 08:52:15"
  "chf" => "daily"
  "pri" => 1
  "images" => array:1 [▶]
]
  • $type is not the URL type, it's the post type.

  • $post is not a Data object for the URL, it's; the post object.

Step-by-step reproduction instructions

  1. Use the filter and dump the passed values.
  2. Observe the values differ from the documentation.

Expected results

Actual results

Screenshots, screen recording, code snippet

No response

Which editor is affected (or editors)

  • Block Editor
  • Gutenberg Editor
  • Elementor Editor
  • Classic Editor
  • Other (please specify in additional info)

Which browser is affected (or browsers)

  • Chrome
  • Firefox
  • Safari
  • Other (please specify in additional info)

Device you are using

No response

Operating system

No response

PHP version

No response

WordPress version

6.9.4

WordPress Theme

No response

Yoast SEO version

trunk

Gutenberg plugin version (if relevant)

No response

Elementor plugin version (if relevant)

No response

Classic Editor plugin version (if relevant)

No response

Relevant plugins in case of a bug

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions