• Hey there!

    Been trying to bulk import snippets of code into custom post types, but I don’t get the plugin to import the stuff I want. I am using WP All Import & Export Pro plugin.

    Like it says in the documentation from Header&Footer Code, every post/page/custom post specific code is saved on _auhfc post meta, and WP All Import detects this meta field without problem, but can’t make it run like I want so it imports the snippet in there.

    The code snippet is basically structured data (Schema) that is helpful to have inserted for every listing for SEO purposes.

    Has anyone tried to do such a job of importing code in bulk through a CSV file or XML Feed? I have a directory site with +150 listings in 7 languages (which makes almost 900 posts), and would like to be able to bulk import the structured data if possible rather than doing it manually, which would take me days to finish.

    I will speak with WP All Import Support too, and let’s see if together we manage to get this running.

    I will be waiting from any possible feedback! From my side, if WP All Import gives me a solution will post it here so it is available for everyone.

    Cheers!

    • This topic was modified 11 months, 2 weeks ago by cXD4931.
    • This topic was modified 11 months, 2 weeks ago by cXD4931.
    • This topic was modified 11 months, 2 weeks ago by cXD4931.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @xbor17,

    Thank you for choosing Head & Footer Code for your plugin!

    I run quick test with default WordPress export/import for regular blog posts and pages, and that worked well.

    I’m going to set up some custom post types on development environment and run more tests. Hope to get back with more info in a few days.

    Thank you for your patience,
    Aleksandar

    Thread Starter cXD4931

    (@xbor17)

    Hey there Aleksandar! Damn, didn’t try the default export/import tool from WordPress. Will give it a try too. And yes, those snippets I am running them on a custom post type. Thanks for quick answer!

    Thread Starter cXD4931

    (@xbor17)

    Hello,

    So it looks that during the importation process with WP All Import, the plugin is actually bringing those values to the database as expected. See next image:

    However, the imported snippet does not appear in the back end of the WordPress dashboard.

    Also I noticed that Head and Footer stores the data in a serialized format unlike the data I am trying to import, includes the information of the snippet behaviour and inserting \ symbols:

    I passed this information to the support team from Wp All Import and their answer is:

    You would either have to

    1. modify your export to include the complete serialized string in case of wanting to update an already imported snippet of code
    2. or write a custom function (more information about custom functions with WP All Import here https://www.wpallimport.com/documentation/inline-php/) in the import end to format the available data to the serialized format that Head and Footer plugin expects.

    I will be doing some more tests in my dummy site till find out a way of achieving this

    Hi @xbor17,

    I hope you are doing well. Not sure if you managed to resolve this issue, so I wrote a helper script to fix plain code in the database.

    https://gist.github.com/urosevic/4001f130f81f98c19654ac3db31a0c6b

    After you do regular import with the plain script code as a value for _auhfc post meta, run the above script. It will read all _auhfc post metas and if it’s not in HFC-compatible format do conversion and put plain code to the head section.

    Give it a try on testing environment and let me know if that works for you.

    Kind regards,
    Aleksnadar

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bulk import code into posts with CSV/XML file’ is closed to new replies.