I think there is a bug in the xml import/export function new in 2.1: The excerpt of a post is not in the xml export. Any idea to fix it?
Helli
I think there is a bug in the xml import/export function new in 2.1: The excerpt of a post is not in the xml export. Any idea to fix it?
Helli
Ok, I have fixed the problem by myself:
In wp-admin\export.php from Line 170:
<description></description>
<excerpt:encoded><![CDATA[<?php echo $post->post_excerpt ?>]]></excerpt:encoded>
<content:encoded><![CDATA[<?php echo $post->post_content ?>]]></content:encoded>
and in wp-admin\import\wordpress.php from Line 228:
$post_author = $this->get_tag( $post, 'dc:creator' );
$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
$post_excerpt = str_replace(array ('<![CDATA[', ']]>'), '', $post_excerpt);
$post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt);
$post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
$post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
$post_content = $this->get_tag( $post, 'content:encoded' );
Works perfect for me.
Helli
Might want to submit your change. Info can be found at http://trac.wordpress.org.
I have also had a problem importing an old Wordpress file. I was using the Wordpress.com 's website as the host (marksinzi.worpress.com). Then I found another host, 110mb.com. I downloaded the Wordpress 2.1 files to my computer. Then I uploaded them to my site on 110mb.com (marksinzi.110mb.com/worpress/) All of this seems to work, I even uploaded a different theme and it worked.
SO then I exported from Wordpress.com (rec'd an .xml file).
I went to the wp-admin for the site on 110mb.com, and tried the import function. I got this error:
Import WordPress
The uploaded file could not be moved to /www/110mb.com/m/a/r/k/s/i/n/z/marksinzi/htdocs/wordpress/wp-content.
Warning: Cannot modify header information - headers already sent by (output started at /www/110mb.com/m/a/r/k/s/i/n/z/marksinzi/htdocs/wordpress/wp-admin/admin-header.php:16) in /www/110mb.com/m/a/r/k/s/i/n/z/marksinzi/htdocs/wordpress/wp-includes/functions.php on line 1219
I saw Helli's fiz for the export.php and import.php files for WP 2.1. But how do I fix the export.php if I am using Wordpress.com?
Try removing the header statement from you datafile generator..
header ("Content-Type: text/xml; charset=UTF-8")
Or try flushing your cache
I don't know why this topic shows as resolved - it is still an issue in 2.3.2 -- post excerpts do not export or import.
Thanks for the fix, Helli - although the line #'s have changed on more recent versions.
(I've submitted the change in the trac.)
This topic has been closed to new replies.