Documentation: The "Exclude a taxonomy term from sitemap" code doesn't do anything
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- wordpress
- Ambito
- documentation
Direzione di ricerca
Inizia da docs/features/xml-sitemaps/api.md e verifica l'esempio documentato di wpseo_exclude_from_sitemap_by_term_ids rispetto al comportamento segnalato. Analizza i filtri correlati citati nell'issue, incluso wpseo_sitemap_entry, quindi aggiorna o rimuovi le indicazioni in modo che il metodo documentato per escludere i termini della tassonomia sia accurato e verificabile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Please give us a description of the issue
On https://github.com/Yoast/developer/blob/main/docs/features/xml-sitemaps/api.md you give a function for removing taxonomy terms from site maps.
I've aadded the following code to my theme functions.php:
function sitemap_exclude_terms( $terms ) {
return [208];
}
add_filter( 'wpseo_exclude_from_sitemap_by_term_ids', 'sitemap_exclude_terms' );
Posts in category ID 208 are still appearing on my post-sitemap.xml. I know it's not a caching issue because I subsequently added a test post and it appeared in the sitemap immediately. I have tested this with numerous different categories and with including single or multiple IDs in the array.
The code should probably either be corrected or removed.
- [X ] I've read and understood the contribution guidelines.
- [X ] I've searched for any related issues and avoided creating a duplicate issue.
UPDATE: The only way I was able to actually successfully filter the sitemap was using the wpseo_sitemap_entry filter. Filters I tried that didn't seem to ever run: wpseo_exclude_from_sitemap_by_term_ids, wpseo_sitemap_exclude_post, and a query with wpseo_sitemap_posts_query. Some sort of clearer documentation might have saved me some time.
- Lingua principale
- JavaScript
- Stelle
- 15
- Fork
- 23
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Yoast/developer
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
TyposAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
Tutte le issue di Yoast/developer
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
developmentseed/deck.gl-raster#693 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
iii-hq/iii#2278 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
dependencies security
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
[DevEx]: Playground specs are excluded from both GUI and CI, so videoPlayground is unreachableApertadev experience
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cuttle-cards/cuttle#1413 ·
I maintainer di solito rispondono entro 1 giorno
-
macOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
beyondcode/herd-community#1761 ·