最佳答案
作为blogged here,你需要的只是export_wp函数,所以运行一些东西.
include 'wp-config.php';
include 'wp-admin/includes/export.PHP';
ob_start();
export_wp();
$file = ob_get_contents();
ob_end_clean();
$fh = fopen("wordpress-" . date('Y-m-d') . ".xml",'w');
fwrite($fh,$file);
fclose($fh);