{"id":17855852,"url":"https://github.com/splorp/wordpress-xml-to-kirby","last_synced_at":"2025-03-20T14:30:46.762Z","repository":{"id":137594655,"uuid":"246125391","full_name":"splorp/wordpress-xml-to-kirby","owner":"splorp","description":"Convert exported WordPress XML data to a file based structure for Kirby","archived":false,"fork":false,"pushed_at":"2023-11-29T21:47:43.000Z","size":62,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-01T00:22:53.770Z","etag":null,"topics":["converter","kirby","kirby-cms","wordpress","xml"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/splorp.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-09T19:35:39.000Z","updated_at":"2024-12-27T15:57:18.000Z","dependencies_parsed_at":"2023-11-29T22:46:49.366Z","dependency_job_id":null,"html_url":"https://github.com/splorp/wordpress-xml-to-kirby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splorp%2Fwordpress-xml-to-kirby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splorp%2Fwordpress-xml-to-kirby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splorp%2Fwordpress-xml-to-kirby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splorp%2Fwordpress-xml-to-kirby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/splorp","download_url":"https://codeload.github.com/splorp/wordpress-xml-to-kirby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244075615,"owners_count":20393979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["converter","kirby","kirby-cms","wordpress","xml"],"created_at":"2024-10-28T02:42:08.338Z","updated_at":"2025-03-20T14:30:46.479Z","avatar_url":"https://github.com/splorp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress XML to Kirby\n\nThis script converts an XML file that has been exported in [WordPress eXtended RSS (WXR)](https://wordpress.org/support/article/tools-export-screen/) format to a flat file YAML structure for use with [Kirby](https://getkirby.com/).\n\nThis version of the code is based on the original [WPXML to Kirby](https://github.com/greywillfade/wpxml-to-kirby) script by [Sally Lait](https://sallylait.com/) with further modifications made by [Stay Regular Media](https://github.com/stayregular/wpxml-to-kirby).\n\n\n## Requirements\n\n+ [PHP](https://www.php.net/) 7.2 or later\n+ [Composer](https://getcomposer.org/)\n+ [HTML To Markdown for PHP](https://github.com/thephpleague/html-to-markdown)\n\n\n## Usage\n\n+ Download this repository and extract the contents to a working directory\n\n```\n/wordpress-xml-to-kirby\n```\n\n+ Install the [Composer](https://getcomposer.org/) dependency manager\n+ Require the [HTML To Markdown for PHP](https://github.com/thephpleague/html-to-markdown) library\n\n```\ncomposer require league/html-to-markdown\n```\n\n+ [Export the content of your WordPress site](https://wordpress.org/documentation/article/tools-export-screen/) to an XML file\n+ To include featured image metadata in the XML file, [see below](#include-featured-image-metadata)\n+ Move to XML file to the working directory\n+ Create an export directory in the working directory with full permissions\n\n```\nmkdir /wordpress-xml-to-kirby/export`\nchmod 777 /wordpress-xml-to-kirby/export\n```\n\n+ Edit `convert.php` to add the name of the XML file and the export directory\n\n```php\n$importfile = 'data.xml';\n$exportdir = 'export/';\n```\n\n+ Convert all the things!\n\n```\nphp convert.php\n```\n\n\n## Include Featured Image Metadata\n\nTo include the featured image metadata in the XML file, the WordPress core `export.php` file must be modified.\n\n+ Open `wp-admin/includes/export.php` in your favourite text editor\n+ Locate the following code block:\n\n```php\n\u003cwp:post_type\u003e\u003c?php echo wxr_cdata( $post-\u003epost_type ); ?\u003e\u003c/wp:post_type\u003e\n\u003cwp:post_password\u003e\u003c?php echo wxr_cdata( $post-\u003epost_password ); ?\u003e\u003c/wp:post_password\u003e\n\u003cwp:is_sticky\u003e\u003c?php echo intval( $is_sticky ); ?\u003e\u003c/wp:is_sticky\u003e\n```\n+ Add the following code directly following the aforementioned code block:\n\n```php\n\u003c?php if ( has_post_thumbnail($post-\u003eID) ) : ?\u003e\n\u003c?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post-\u003eID), 'full') ?\u003e\n\u003cwp:attachment_url\u003e\u003c?php echo wxr_cdata( $image[0] ); ?\u003e\u003c/wp:attachment_url\u003e\n\u003c?php endif; ?\u003e\n```\n\nAfter this modification, the exported XML data will include links to any full sized featured images attached to pages or posts.\n\nYou can also modify the `get_post_thumbnail_id` function to retrieve a link to another image size or include additional XML objects for multiple image sizes.\n\n\n## Release Notes\n\n### 20230122 — The “Clean Up In Aisle Five” Release\n\n+ Better handling of posts with empty `\u003ctitle\u003e` fields\n+ Better handling of posts with `\u003ctitle\u003e` fields containing accented characters\n+ Paragraph breaks are now maintained when processing `\u003ccontent:encoded\u003e`\n+ Renamed several named array keys for clarity and consistency\n+ Tweaked formatting of exported files because pretty\n+ Renamed script from `index.php` to `convert.php` because that’s what it does\n\n### 20200630 — The “Little Bump” Release\n\n+ Updated [HTML to Markdown for PHP](https://github.com/thephpleague/html-to-markdown) to version [4.10.0](https://github.com/thephpleague/html-to-markdown/releases/tag/4.10.0)\n\n### 20200309 — The “Compositionally Challenged” Release\n\n+ Updated [HTML to Markdown for PHP](https://github.com/thephpleague/html-to-markdown) to version [4.9.1](https://github.com/thephpleague/html-to-markdown/releases/tag/4.9.1)\n+ Added checks for items that do not have associated `attachment_url` data\n+ Fixed missing space preceding `Text:` content\n\n### 20200308 — The “Word Up” Release\n\n+ Initial release based on the [WPXML to Kirby](https://github.com/stayregular/wpxml-to-kirby) script\n+ Removed `index-events.php` for Modern Tribe’s [The Event Calendar](https://theeventscalendar.com/product/wordpress-events-calendar/) exports\n+ Updated read me to describe this version of the script\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplorp%2Fwordpress-xml-to-kirby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsplorp%2Fwordpress-xml-to-kirby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplorp%2Fwordpress-xml-to-kirby/lists"}