<p>Currently, the only facility for doing this would be to use an SEO Settings field in that field layout, and manually override the setting on a per-entry basis.</p>
<p>I can think of two possible solutions:</p>
<ol>
<li><p>I allow the &quot;Include in Sitemap&quot; field to have a text entry option where you can enter Twig to put your custom condition</p>
</li>
<li><p>Trigger an event that a custom PHP module or plugin can listen for, and do the evaluation there in terms of whether the entry should be included in the sitemap or not</p>
</li>
</ol>
<p>But before we go down that road, can you elaborate on what you're trying to accomplish here? Just excluding something from the sitemap alone does not prevent it from getting indexed.</p>
<p>More here: <a href="https://nystudio107.com/blog/seo-myths-top-5-sitemap-myths-demystified" rel="nofollow noreferrer">SEO Myths: Top 5 Sitemap Myths Demystified</a></p>

CC BY-SA 4.0
2023-11-20T08:24:35.383Z
Thanks for your overview. We utilize a custom entry type named Author, featuring a dedicated checkbox field designed to signify whether the author is associated with the period post-2021. When the checkbox is activated, it indicates that an author page need not be created and, consequently, should be excluded from the sitemap. Nonetheless, concerning blog posts, I desire the author's name to be visible without a hyperlink when the checkbox is enabled. If the checkbox is disabled, the link should direct to the author's profile, while if enabled, no link to an author page should be established.
Thangaraj Moorthi
CC BY-SA 4.0
2023-11-20T16:18:29.200Z
Yeah so if it is a public URL, whether it's in the sitemap or not, Google will eventually find it and index it, FWIW.
andrew.welch
CC BY-SA 4.0
2024-02-22T14:55:58.237Z
we're in a similar situation over here, and AFAIK:

If a URL in your sitemap redirects (301) to a page that ultimately results in a 404 error, Google is unlikely to index the final URL because it signals that the content is not available. While discovery is influenced by the sitemap, the final indexing decision is based on the availability and quality of content at the final URL...isn't it?

(BTW: we're doing exactly that: public URL >>> 301 on 404.
ricricucit
CC BY-SA 4.0
2023-11-17T16:02:14.273Z
2023-11-17T16:02:14.273Z
andrew.welch
<p>I want to exclude certain URLs from the sitemap, depending on the custom field settings in their corresponding entries.
I'm using SEO Matic plugin in craft4</p>

<craft4><plugin-sitemap><seomatic>
Omit specific URLs from the sitemap
# Omit specific URLs from the sitemap

(Asked by: username_0 on 2023-11-17)

I want to exclude certain URLs from the sitemap, depending on the custom field settings in their corresponding entries.
I'm using SEO Matic plugin in craft4

**Tags:** craft4, plugin-sitemap, seomatic

---

## 1 answers

### Answer by username_1 on 2023-11-17. Score: 2

Currently, the only facility for doing this would be to use an SEO Settings field in that field layout, and manually override the setting on a per-entry basis.

I can think of two possible solutions:

1. I allow the "Include in Sitemap" field to have a text entry option where you can enter Twig to put your custom condition
2. Trigger an event that a custom PHP module or plugin can listen for, and do the evaluation there in terms of whether the entry should be included in the sitemap or not

But before we go down that road, can you elaborate on what you're trying to accomplish here? Just excluding something from the sitemap alone does not prevent it from getting indexed.

More here: [SEO Myths: Top 5 Sitemap Myths Demystified](https://nystudio107.com/blog/seo-myths-top-5-sitemap-myths-demystified)

> **Comments:**
> **username_0**: Thanks for your overview. We utilize a custom entry type named Author, featuring a dedicated checkbox field designed to signify whether the author is associated with the period post-2021. When the checkbox is activated, it indicates that an author page need not be created and, consequently, should be excluded from the sitemap. Nonetheless, concerning blog posts, I desire the author's name to be visible without a hyperlink when the checkbox is enabled. If the checkbox is disabled, the link should direct to the author's profile, while if enabled, no link to an author page should be established.  
> **username_1**: Yeah so if it is a public URL, whether it's in the sitemap or not, Google will eventually find it and index it, FWIW.  
> **username_2**: we're in a similar situation over here, and AFAIK:  If a URL in your sitemap redirects (301) to a page that ultimately results in a 404 error, Google is unlikely to index the final URL because it signals that the content is not available. While discovery is influenced by the sitemap, the final indexing decision is based on the availability and quality of content at the final URL...isn't it?  (BTW: we're doing exactly that: public URL >>> 301 on 404.  

---

