WordPress XML export: posts have no categories or tags since 5.6.6

Aperta
#248 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@rafaelmaeuer ci sta già lavorando.

Dal 29/10/2026.

  • #253 di @rafaelmaeuer — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
php, wordpress
Ambito
backend, data

Direzione di ricerca

The issue points to the WordPress XML export job, setup_postdata(), wxr_post_taxonomy(), and the get_terms() call, but gives no file path or test name. Start by locating those entry points and reading the export changes from 5.6.6. Done means each post retains its category, tag, and custom term assignments, with each term exported once; a linked open pull request already contains a fix.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
Since 5.6.6 the "WordPress XML export" job writes every <item> without its <category domain="…"> elements. Importing the file loses all category, tag and custom term assignments of posts. On sites without custom taxonomies, all categories and tags are additionally exported a second time as <wp:term> entries.

To Reproduce

  1. Create a post with a category and a tag.
  2. Run a job with "WordPress XML export".
  3. Open the .xml file: the post's <item> has no <category> lines. On a default install, each category and tag also appears both as <wp:category>/<wp:tag> and as <wp:term>.

Cause
5.6.6 renamed the loop variable from the global $post to $post_item and calls setup_postdata( $post_item ), which does not set the global post. wxr_post_taxonomy() uses get_post() without an argument and gets null. The duplicate terms come from get_terms() being called with an empty taxonomy list, which returns the terms of all taxonomies.

Expected behavior
Exported posts keep their terms, and each term is exported once.

System

  • BackWPup 5.6.6 – 5.7.8

A fix is ready as a pull request (together with an endless-loop fix for orphaned terms and the PHP 8.2 utf8_encode() deprecation).

Lingua principale
PHP
Stelle
96
Fork
48
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wp-media/backwpup

Tutte le issue di wp-media/backwpup

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.