Tuesday, August 16, 2022
HomeWordPress Developmentimport - Exporting posts that do not use ACF fields to a...

import – Exporting posts that do not use ACF fields to a weblog that makes use of ACF fields/versatile content material


I will attempt to clarify it right here, moderately than the title.

I’m trying to export content material from a weblog that makes use of the fundamental WYSIWYG editor, and import these posts into a brand new website that makes use of ACF fields (versatile content material) to edit/add publish content material. On the brand new website I’ve the fundamental WYSIWYG editor hidden.

I’ve executed some take a look at exports to see what information I’m working with, and have the next XML construction when it’s utilizing the fundamental WYSIWYG editor

<content material:encoded><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut lobortis euismod tellus, sit amet venenatis quam imperdiet sed.]]></content material:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>

And the XML construction of posts utilizing the ACF/versatile content material fields is like so:

<wp:postmeta>
    <wp:meta_key><![CDATA[content_blocks_0_copy]]></wp:meta_key>
    <wp:meta_value>
        <![CDATA[<div>
            <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sagittis diam ut dapibus finibus.</div>
        </div>]]>
    </wp:meta_value>
</wp:postmeta>
<wp:postmeta>
    <wp:meta_key><![CDATA[_content_blocks_0_copy]]></wp:meta_key>
    <wp:meta_value><![CDATA[field_62e26ca72727d]]></wp:meta_value>
</wp:postmeta>

So what occurs once I import the fundamental information is I get the titles, permalinks, and issues like that. However the content material will not be seen/within the versatile content material fields. If I unhide the usual editor area, the content material is imported in there.

Will I have to construction the XML information in the identical means (that matches the ACF construction) for every publish I’m trying to import? Once I did a take a look at of modifying the construction to match that of an ACF area, it nonetheless didn’t import the content material appropriately.

Am I higher off together with the outdated/customary editor together with the ACF fields, or have others come throughout an identical difficulty and used one other methodology?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments