Skip to content

Instantly share code, notes, and snippets.

@hermanussen
Created November 21, 2016 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hermanussen/ffccd7f22654ce6f9a9ea8d5e527400e to your computer and use it in GitHub Desktop.
Save hermanussen/ffccd7f22654ce6f9a9ea8d5e527400e to your computer and use it in GitHub Desktop.
SELECT concat('insert into wp_posts (post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_content_filtered, post_parent, guid, menu_order, post_type, post_mime_type, comment_count)
values (1, \'', created, '\', \'', created, '\', \'', replace(cast(`introtext` as char(99999)), '\'', '\'\''), replace(cast(`fulltext` as char(99999)), '\'', '\'\''), '\', \'', replace(title, '\'', '\'\''), '\', \'\', \'publish\', \'closed\', \'closed\', \'\', \'', alias, '\', \'\', \'\', \'', modified, '\', \'', modified, '\', \'\', 0, \'[your_site_url]/uncategorized/', alias, '/\', 300, \'post\', \'\', 0);')
FROM `jos_content`
WHERE `created` > '2014-10-06 00:00:00' and parentid = 0
ORDER BY `created` desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment