sladedesign Posted September 8, 2022 Share Posted September 8, 2022 How do I export all blog posts as xml or csv files to be used elsewhere. thanks Link to comment Share on other sites More sharing options...
AndZyk Posted September 8, 2022 Share Posted September 8, 2022 Hello @slatedesign, for CSV have a look at this topic: As for XML I don't know why you would need this. Regards, Andreas Link to comment Share on other sites More sharing options...
sladedesign Posted September 8, 2022 Author Share Posted September 8, 2022 Thanks, this post talks about pages only. Will it export posts too? Wordpress deals with XML files for importing. Ta Link to comment Share on other sites More sharing options...
AndZyk Posted September 8, 2022 Share Posted September 8, 2022 In ProcessWire everything is a page. There is no separation between pages and posts like in WordPress. So yes, the solutions in this thread should work too. ? 1 Link to comment Share on other sites More sharing options...
sladedesign Posted September 9, 2022 Author Share Posted September 9, 2022 Ok great thanks and that explains it. 1 Link to comment Share on other sites More sharing options...
sladedesign Posted September 15, 2022 Author Share Posted September 15, 2022 @AndZyk can I get some more help with this module. I have now installed it but can't see any logical way to export just the fields for blog posts. I've tried various options but it either exports a blank CSV or a list of the pages? Thanks Link to comment Share on other sites More sharing options...
AndZyk Posted September 19, 2022 Share Posted September 19, 2022 @sladedesign You mean the module BatchChildEditor? I don't have much experience with this module but you can enable the Export CSV mode under Mode Settings in the module configuration. There you can also configure the CSV export settings. Then you have to set where the editing tools are available and you can see them under the children tab of those pages. There you can export the children of the page as CSV. Do you want to export your blog posts from ProcessWire as CSV to import them into a WordPress website? Or what is it you want to achieve? Link to comment Share on other sites More sharing options...
sladedesign Posted September 26, 2022 Author Share Posted September 26, 2022 Hey @AndZykthanks for getting back to me and yes the module is installed and ready to use. I'm just not used the terminology, interface or structure to see a logical way to export firstly all blog posts, then all users so they can both be imported into Wordpress. Any advice would be very useful. Link to comment Share on other sites More sharing options...
AndZyk Posted September 26, 2022 Share Posted September 26, 2022 I am not sure, if this module works for exporting users as CSV. You could write your own CSV export script, like also mentioned in the thread posted above: Just write the code at the beginning of your template: <?php header('Content-Type: text/csv'); header('Content-Disposition: attachment; filename="blog-posts.csv"'); $items = $pages->find("template=blog-post"); echo "title,url" . PHP_EOL; // Add more fields here foreach($items as $item) { echo "\"$item->title\",\"$item->url\"" . PHP_EOL; // Add more fields here } return $this->halt(); For users this script could look like this: <?php header('Content-Type: text/csv'); header('Content-Disposition: attachment; filename="users.csv"'); $items = $pages->find("template=user, include=all"); echo "name,url,email,password" . PHP_EOL; foreach($items as $item) { echo "\"$item->name\",\"$item->url\",\"$item->email\",\"$item->pass\"" . PHP_EOL; } return $this->halt(); But the user password is stored encrypted, so I don't think that this would help you much. Or don't switch to WordPress. ? Regards, Andreas Link to comment Share on other sites More sharing options...
sladedesign Posted September 26, 2022 Author Share Posted September 26, 2022 Thanks for the help and advice. I've manually cut and paste the users as there was only a few hundred. Still confused about the process for exporting posts though so if you have any advice on that I'd be delighted. Alas WP is my primary platform and pretty much embedded in my business for 8 years now. Link to comment Share on other sites More sharing options...
zoeck Posted September 26, 2022 Share Posted September 26, 2022 24 minutes ago, sladedesign said: Still confused about the process for exporting posts though so if you have any advice on that I'd be delighted. There's no "ready to use" export function in processwire, but you can easily create one like described in the posts of AndZyk. But I think you have not understood how Processwire works ? a simple introduction can be found here https://processwire.com/docs/tutorials/hello-worlds/ The important thing is that you understand that the export must be programmed by you via php. The module "BatchChildEditor" simplifies the whole thing only a little. In the module description there is also a simple example: https://processwire.com/modules/batch-child-editor/ But you need an understanding of how PW is structured (Everything is a page, every page has a template, every template has fields, every field has a certain type). 1 Link to comment Share on other sites More sharing options...
cb2004 Posted September 27, 2022 Share Posted September 27, 2022 If you want something official, then you could use this: https://processwire.com/talk/store/category/9-listerpro/ This has an export to CSV action which you would download from the relevant forum once you have purchased it. I am not sure as I haven't had the need for it yet, but Excel can then save to XML. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now