[Resuelto] Export a post type (data, not structure)
This support ticket is created hace 4 años, 9 meses. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
In case anyone else sees this, I just used sql and it worked fine. For a one off project, paying $100 for this is not good. I will make a video at some point, but here are the basics. I used phpmyadmin just because it was on the clients site.
-----
This finds the post types so you can get the proper name.
SELECT DISTINCT( post_type ) FROM wp_posts;
This finds the meta data that is hooked up.
SELECT P.ID, P.post_title, M.meta_key, M.meta_value
FROM wp_posts AS P
INNER JOIN wp_postmeta AS M ON M.post_id = P.ID
WHERE P.post_type = 'upbeat-news'
and P.post_status = 'publish'
ORDER BY post_title, meta_key
Then use this to get the actual data you care about (note, I have hard-coded this query. As I said, this is a one off. If you are going to use this many times, just pay for the official plugin.) You can then export as csv from phpmyadmin:
select p.post_title, p.post_content, p.post_name, (select meta_value from wp_postmeta as m1
where m.post_id = m1.post_id
and m1.meta_key = 'wpcf-memorial-first-name') first_name,
(select meta_value from wp_postmeta as m1
where m.post_id = m1.post_id
and m1.meta_key = 'wpcf-memorial-last-name') as last_name,
(select meta_value from wp_postmeta as m1
where m.post_id = m1.post_id
and m1.meta_key = 'wpcf-memorial-date-of-death') as death_date
from wp_posts as p
right join wp_postmeta as m ON m.post_id = p.ID
WHERE p.post_type = 'alumni-memorial'
and p.post_status = 'publish'
GROUP BY p.ID