先安装Wordpress,数据库名为tempdb,然后把drupal的数据也导入到这个数据库里。 然后在phpmyadmin里按顺序执行下面的SQL语句 清空WP的数据 代码: TRUNCATE TABLE tempdb.wp_comments; TRUNCATE TABLE tempdb.wp_links; TRUNCATE TABLE tempdb.wp_postmeta; TRUNCATE TABLE tempdb.wp_posts; TRUNCATE TABLE tempdb.wp_term_relationships; TRUNCATE TABLE tempdb.wp_term_taxonomy; TRUNCATE TABLE tempdb.wp_terms; 导入分类 代码: INSERT INTO tempdb.wp_terms (term_id, `name`, slug, term_group) SELECT d.tid, d.name, REPLACE(LOWER(d.name), ' ', '-'), 0 FROM tempdb.term_data d INNER JOIN tempdb.term_hierarchy h USING(tid) ; INSERT INTO tempdb.wp_term_taxonomy (term_id, taxonomy, description, parent) SELECT d.tid `term_id`, 'category' `taxonomy`, d.description `description`, h.parent `parent` FROM tempdb.term_data d INNER JOIN tempdb.term_hierarchy h USING(tid) ; 导入内容 代码: INSERT INTO tempdb.wp_posts (id, post_date, post_content, post_title, post_excerpt, post_name, post_modified) SELECT DISTINCT n.nid, FROM_UNIXTIME(created), body, n.title, teaser, REPLACE(REPLACE(REPLACE(REPLACE(LOWER(n.title),' ', '-'),'.', '-'),',', '-'),'+', '-'), FROM_UNIXTIME(changed) FROM tempdb.node n, tempdb.node_revisions r WHERE n.vid = r.vid 链接分类 代码: INSERT INTO tempdb.wp_term_relationships (object_id, term_taxonomy_id) SELECT nid, tid FROM tempdb.term_node; 更新评论数 代码: UPDATE wp_term_taxonomy tt SET `count` = ( SELECT COUNT(tr.object_id) FROM wp_term_relationships tr WHERE tr.term_taxonomy_id = tt.term_taxonomy_id ); 隐藏未审核的评论 代码: INSERT INTO tempdb.wp_comments (comment_post_ID, comment_date, comment_content, comment_parent, comment_author, comment_author_email, comment_author_url, comment_approved) SELECT nid, FROM_UNIXTIME(timestamp), comment, thread, name, mail, homepage, status FROM tempdb.comments; 更新评论数 代码: UPDATE `wp_posts` SET `comment_count` = (SELECT COUNT(`comment_post_id`) FROM `wp_comments` WHERE `wp_posts`.`id` = `wp_comments`.`comment_post_id`); 修正换行 代码: UPDATE tempdb.wp_posts SET post_content = REPLACE(post_content, '', ''); 修正图片路径,这个看情况执行 代码: UPDATE tempdb.wp_posts SET post_content = REPLACE(post_content, '"/sites/default/files/', '"/wp-content/uploads/'); 然后把drupal的表都删了就行了