Pull data from WordPress

2019-03-02 06:20发布

What's the best way to pull data from Wordpress database? I think creating a plugin would be nice. Is there a tutorial out there that do the job? Or a plugin that does it? Pull content of the page via JSON/XML.

Cheers, Mickey

标签: wordpress
3条回答
Animai°情兽
2楼-- · 2019-03-02 06:47

If you are looking to integrate HTML from Wordpress in a PHP-driven site, the easiest and fastest way is to include the WordPress main include, and use the native WP functions to get hold of the data.

Just one caveat from experience: Wordpress is fat. Including the wordpress header file will eat up 8-12 MB of your allocated per-script memory (usually somewhere between 16-64 MB) from the start. You may be able to steer around that, however, by loading the Wordpress data in a different script, or caching the requests (probably a good idea anyway).

WordPress also has basic built-in RSS export functionality.

查看更多
【Aperson】
3楼-- · 2019-03-02 06:48

A generic easy way to export data from a mySQL database in XML format could be phpmyadmin.net

查看更多
疯言疯语
4楼-- · 2019-03-02 06:57
登录 后发表回答