Pregunta

If I use the WordPress import feature avaialbale at

Tools -> Import

with a WordPress export file that contains the following

<wp:category>
    <wp:category_nicename><![CDATA[magento]]></wp:category_nicename>
    <wp:cat_name><![CDATA[Magento]]></wp:cat_name>
</wp:category>

WordPress will create a category. The category's name will be Magento, and its slug/nicename will be magento. However, if I attempt to import a second file with a slightly edited name

<wp:category>
    <wp:category_nicename><![CDATA[magento]]></wp:category_nicename>
    <wp:cat_name><![CDATA[Magento Ecommerce]]></wp:cat_name>
</wp:category>

It (seems like?) WordPress will not update the category name. i.e. You can use the import files to create new categories, but not edit new categories.

Is there a way to configure WordPress's import XML files such that an entry for a category (or post, or taxonomy term) will be updated without needing to know the numerical ID of the category? I'm mainly wondering if this exists for core WordPress, but feel free to also recommend plugins/extensions.

¿Fue útil?

Solución

Import can be used for adding new "items" to wordpress, but not changing existing ones. If you want to update anything you should use the xml-rpc protocol with the relevant commands https://codex.wordpress.org/XML-RPC_WordPress_API, or if you need it only locally wpcli http://wp-cli.org/ might be even better (never used it for your specific type of change but I assume you can do it with it)

Licenciado bajo: CC-BY-SA con atribución
scroll top