lainchan / Ω

Pulling body content out of Wordpress

Guthrie · 2019-03-01 21:44
I've been thinking lately about slimming down my Wordpress blog. Also, pondering making my content usable outside of the Wordpress database (for my own purposes. I'm not sure anyone would find my blog posts very interesting). Also, to be quite frank, I'm a little bit over Wordpress and am thinking of handrolling something. Nothing fancy; just something I can understand without combing through a manual. Anyway, I thought I would make a PHP script to cycle through the posts and read the body content of each of the posts in the Wordpress site, then save a file out based on the post title. It would just be a series of HTML fragments, but I could figure out what to do with them later. Does this sound reasonable? Has anyone here tried something similar?
Tyrell Wellick · 2019-03-02 03:31
Another dirty but lazy idea, you could follow up the WordPress wiki page about making a backup, then restore to a virtual machine that has a similar configuration to your web server. That way you could take thinks offline and use WordPress locally in case you need to retrieve some data. That should save you some time.
Yamaoto Toshi · 2019-03-04 09:32
>wordpress You already failed
Drano · 2019-03-04 19:34
>>15950 >PHP script to cycle through the posts Sure, that would work. Were you thinking of using a wordpress function like get_posts ? Or iterate directly on the database ? Because the second should be easier, as long as you don't need to filter the posts, just dump them all. That said, I'm not sure why you would want your posts in plain files, it seems to me that they would be easier to work with in the database.