---
title: Filtrer le lien d’archive de type de publication dans le plan de site XML
url: "https://www.seopress.org/fr/support/hooks/filtrer-le-lien-darchive-de-type-de-publication-dans-le-plan-de-site-xml/"
lang: fr-FR
updated: 2021-03-01
hook_name: seopress_sitemaps_no_archive_link
required_version: 4.5
---

# Filtrer le lien d’archive de type de publication dans le plan de site XML

- **Hook name:** `seopress_sitemaps_no_archive_link`
- **Required version:** 4.5

```php
//To remove CPT archive link
add_filter('seopress_sitemaps_no_archive_link', '__return_false');

//To edit CTP archive URL
function sp_sitemaps_no_archive_link($sitemap_url, $path) {
    if ($path ==='product') {//Check the custom post type key
        $sitemap_url = sprintf("<url>\n<loc>%s</loc>\n</url>", htmlspecialchars(urldecode('https://example.com/post-type-archive-link')));
    }
	return $sitemap_url;
}
add_filter('seopress_sitemaps_no_archive_link', 'sp_sitemaps_no_archive_link', 10, 2);
```

Source: [https://gist.github.com/wp-seopress/48038efa879f5374360f59b3bd0cfae0](https://gist.github.com/wp-seopress/48038efa879f5374360f59b3bd0cfae0)



