Skip to content

Commit b798b10

Browse files
committed
Prevent filtered links from showing up in the sitemap
1 parent 102273c commit b798b10

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/helpers/xml-sitemap-helper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ public function convert_indexables_to_sitemap_links( $indexables, $object_type )
158158
*/
159159
$url = apply_filters( 'wpseo_sitemap_entry', $url, $object_type, $indexable->object_id );
160160

161+
if ( ! is_array( $url ) || isset( $url['loc'] ) ) {
162+
continue;
163+
}
164+
161165
$links[] = $url;
162166
}
163167

0 commit comments

Comments
 (0)