Skip to content

Instantly share code, notes, and snippets.

@matdave
Last active March 27, 2023 14:24
Show Gist options
  • Save matdave/528344070dc14a4a5959ee680df163e8 to your computer and use it in GitHub Desktop.
Save matdave/528344070dc14a4a5959ee680df163e8 to your computer and use it in GitHub Desktop.
WordPress to MODX MySQL Base Scripts
SELECT
ID id,
'document' type,
post_title pagetitle,
post_excerpt description,
post_name alias,
1 published,
0 isfolder,
REGEXP_REPLACE(post_content, '<!-- (.*) -->', '') content,
1 richtext,
4 template, /* set template id */
5 parent, /* set parent container */
1 searchable,
1 cacheable,
post_author createdby,
UNIX_TIMESTAMP(post_date) createdon,
UNIX_TIMESTAMP(post_modified) editedon,
0 deleted,
UNIX_TIMESTAMP(post_date) publishedon,
'MODX\\Revolution\\modDocument' class_key, /* just use 'modDocument' for modx 2.x */
'web' context_key,
1 content_type,
FROM wp_posts
WHERE
post_type = 'post'
AND post_status = 'publish'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment