wordpress_content.yml in WordPress Migrate 8.3
migrations/wordpress_content.yml
File
migrations/wordpress_content.ymlView source
- id: wordpress_content
- label: Import content from WordPress XML
- migration_tags:
- - WordPress
- source:
- plugin: url
- data_fetcher_plugin: http
- data_parser_plugin: xml
- # The item type selector (e.g. '[wp:post_type="post"]') is appended dynamically.
- item_selector: /rss/channel/item
- fields:
- -
- name: title
- label: Content title
- selector: title
- -
- name: post_id
- label: Unique content ID
- selector: wp:post_id
- -
- name: content
- label: Body of the content
- selector: content:encoded
- -
- name: excerpt
- label: Excerpt of the content
- selector: excerpt:encoded
- -
- name: pubDate
- label: Publish date of the content
- selector: pubDate
- -
- name: post_date
- label: Post date of the content
- selector: wp:post_date
- -
- name: status
- label: Published status of the content
- selector: wp:status
- -
- name: creator
- label: Username of the content creator
- selector: dc:creator
- -
- name: post_tag
- label: Tags assigned to the content item
- selector: 'category[@domain="post_tag"]/@nicename'
- -
- name: category
- label: Categories assigned to the content item
- selector: 'category[@domain="category"]/@nicename'
- -
- name: thumbnail_id
- label: Thumbnail assigned to the content item (Featured image)
- selector: wp:postmeta[wp:meta_key='_thumbnail_id']/wp:meta_value
- ids:
- post_id:
- type: integer
- process:
- # type mapping is dynamically generated.
- # uid mapping is dynamically generated.
- # tag/category field mappings are dynamically generated.
- title: title
- # @todo: Will need process plugin to rewrite links/img refs.
- # @link https://www.drupal.org/node/2742279
- 'body/value': content
- 'body/summary': excerpt
- created:
- plugin: callback
- source: post_date
- callable: strtotime
- changed: '@created'
- status:
- plugin: static_map
- source: status
- default_value: 0
- map:
- publish: 1
- destination:
- plugin: entity:node
- # Dependencies are dynamically generated.
- migration_dependencies: {}