Es extremadamente fácil mover tu sitio WordPress usando un plugin de copia de seguridad. ¿Pero qué pasa si solo quieres mover un tipo de contenido personalizado? En este artículo, le mostraremos cómo importar y exportar tipos de contenido personalizados en WordPress. También le mostraremos cómo importar cualquier taxonomía personalizada asociada a sus tipos de entradas.
Hay dos pasos para exportar e importar un tipo de contenido personalizado en WordPress. El primer paso consiste en migrar el tipo de contenido personalizado y las taxonomías. El segundo paso es importar los datos del tipo de entrada.
A menudo los tipos de contenido personalizados en WordPress están asociados con sus propias taxonomías personalizadas. Le mostraremos cómo exportar/importar sus taxonomías personalizadas junto con su tipo de entrada.
Exportación de tipos de contenido personalizado y taxonomías en WordPress
Algunos usuarios prefieren crear sus tipos de contenido personalizados y taxonomías añadiendo código en el archivo functions. php de su tema o en un plugin específico del sitio. En ese caso, todo lo que necesita hacer es copiar ese código y pegarlo en el sitio donde desea importarlos.
Sin embargo, en algunos casos es posible que no puedas localizar el código. No te preocupes, puedes seguir creando el mismo tipo de contenido personalizado en el nuevo sitio.
Todo lo que necesitas saber es el valor de la clave de la entrada. Este es el nombre utilizado para el tipo de contenido en la base de datos de WordPress. Puedes encontrarlo simplemente visitando el tipo de contenido en tu área de administrador de WordPress.
Una vez que tenga la clave de la entrada, visite el sitio donde desea importar el tipo de entrada y utilice el plugin Custom Post Types UI para crear su tipo de contenido personalizado.
También puede obtener la clave de taxonomía personalizada simplemente viendo la taxonomía personalizada en el área de administrador.
Utilice el plugin CPT UI para crear la misma taxonomía en el sitio de destino donde desea importar la taxonomía.
Repita el proceso para todos los tipos de contenido personalizado y taxonomías que desea importar.
Bonus Tip: Si usaste el plugin CPT UI para crear tu tipo de contenido, también puedes usarlo para migrarlo. Pero esto solo funciona si el tipo de contenido personalizado original fue creado usando este plugin. Visita la sección Importar / Exportar en los ajustes del plugin y sigue las instrucciones en pantalla.
Tipos de contenido personalizado y taxonomías creadas por plugins
Muchos plugins populares de WordPress utilizan tipos de contenido personalizados y taxonomías para manejar tipos de contenido personalizados. Por ejemplo, Soliloquy los utiliza para crear carruseles / controles deslizantes, los plugins de eCommere los utilizan para crear productos, etc.
Si desea seguir utilizando esos plugins, entonces no necesita importar CPTs. Simplemente instale el plugin en el sitio de destino, y usted tendrá los tipos de contenido personalizado y taxonomías listo en su sitio.
Muchos de estos plugins vienen con sus propias características de importación / exportación, pero si un plugin no tiene esa característica todavía se puede exportar los datos.
Exportar / Importar datos de tipos de contenido personalizados y taxonomías en WordPress
WordPress viene con una potente herramienta de importación/exportación que le permite exportar e importar datos de WordPress. Simplemente vaya a Herramientas ” Exportar.
Verá todos sus tipos de entradas en un catálogo. Seleccione los tipos de entradas que desea exportar y pulse el botón Descargar archivo de exportación.
WordPress preparará un archivo de exportación XML y su navegador / explorador comenzará a descargarlo.
Ahora cambie a su sitio de destino donde desea importar estos datos. Vaya a Herramientas ” Importar. Verá una serie de opciones, haga clic en WordPress.
Aparecerá un mensaje / ventana emergente pidiéndole que instale el plugin importador de WordPress. Haga clic en el botón de instalación y, a continuación, haga clic en el enlace Activar plugin y ejecutar import ador.
En la pantalla del importador, tienes que hacer clic en el botón de elegir archivo y luego seleccionar el archivo XML que descargaste anteriormente. A continuación, haga clic en el botón para subir el archivo y exportarlo.
WordPress importará ahora los datos de su tipo de contenido personalizado. Se importarán todos los tipos de contenido personalizados que haya seleccionado anteriormente. WordPress también añadirá automáticamente términos a las taxonomías personalizadas.
Eso es todo, esperamos que este artículo le haya ayudado a importar y exportar tipos de contenido personalizados y taxonomías en WordPress.
Si te ha gustado este artículo, suscríbete a nuestro canal de YouTube para ver tutoriales en vídeo sobre WordPress. También puedes encontrarnos en Twitter y Facebook.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Kerry says
I am trying to export CPT data, but the WP export tool doesn’t list the CPT. I’m using the CPT UI plugin. Any help?
WPBeginner Support says
For that specific plugin, you would want to check under CPT UI, Tools and you should see that plugin’s specific method for importing and exporting post types.
Administrador
Bulut says
There are people, Trouble Maker
There are Bloggers, Trouble Eraser
Thanks guys. You saved my day and time!
WPBeginner Support says
Glad our guide was helpful
Administrador
Gabriela says
Hi!
We are switching themes – we want a new site basically – hopefully with a cleaner backend. The switch is from a custom-built theme to a new theme.
Would it be best to install a new theme within our same back end, or would it be cleaner to export and import into a new backend?
Raf says
Clear incoherence between title and intent and practical advises:
1) says “Exporting Custom Post Types and Taxonomies in WordPress”
2) says “in some cases you may not be able to locate the code.”
3) says “Don’t worry you can still create the same custom post type on the new site.”
So if the post-type is created using the UI : you can not export it but only create it again. Why the article doesn’t clearly state it?
Francis says
So let say for instance if I was using a paid plugin that has to do with custom posts and want to switch to the free version how will i go about it? Am still very new to wordpress
stefano says
Hi, can I ask you what plugin do you use for the social share?
thanks
WPBeginner Support says
Hi Stefano,
We use custom code written specifically for our own use.
Administrador
David says
How can you export and have the option of exporting by month like you have when you export post and page?
charles says
When exporting custom post types it doesn’t export the featured image url path. Any idea how to resolve this?
Amy says
Can I export a custom type type and import it as a different post type? Is that possible?
Paul says
I’m trying to do this too, which is why I landed here. I’m trying to rename a custom post type without losing the post data. Not having much luck.
Jhony Penagos says
Thank you !! It work for me.
Chris says
Does related custom field data get packaged with the custom post type export?
Carlitos says
It does not. you will want to bring that over either in your functions file or enter it in manually if you are using a plugin.
Jim D says
Is this something you would need to do if you are using a custom post type currently and wish to switch to a different theme?
WPBeginner Support says
It depends on how you created the custom post types in the first place. If these custom post types were created by your old theme then you will need to export them before switching theme. If the custom post types were created using a plugin then they would remain unaffected when you switch the theme. Lastly, if you created the custom post type by adding code into your theme’s functions file then you just need to copy that code and paste it in your new theme.
Administrador
Philip Downer says
This article should have a bit of clarification. As Kris touched on, you can only import a custom post type if that specific custom post type actually exists on the destination site. You’ll need to either export and include the code that registers the post type; or if you’re using a plugin to handle custom post types, you’ll need to ensure that the same settings are used.
WPBeginner Support says
If you take a look at the article, the first section is about duplicating the CPT to the site where you want to import CPT data.
Administrador
Kris says
Not to forget: themes also make their own custom post types (portfolio for example). Not only moving a site, but also switching themes can also be difficult
I ended up coding the post type and taxonomies in a separate site-specific plugin with the aid of generatewp.com; I was surprised how easy it went and found it less confusing then CPT-UI
Sophia says
What does importing and exporting custom post types do? Sorry, I’m such a newb.
WPBeginner Support says
It comes in handy when you specifically want to move content from a custom post type to another site.
Administrador