• First: thank you for this plugin–it looks like it’s going to work very well for me! My question is: I am importing many issues of a journal. Each journal has a date and an issue number towards the top of the file. I’ve managed (quite easily–thanks!) to bring those field into custom field at import. But how can I remove them from the content area? In other words, I want that data after import to appear ONLY in the custom fields.

    Thank you again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Stephanie Leary

    (@sillybean)

    How comfortable are you with code? In the html-importer.php file, the $customfields array is populated by line 587 or so. Somewhere between that and wp_insert_post(), you could use str_replace() to remove one of the $customfields elements from $my_post[‘post_content’].

    Thread Starter shapal

    (@shapal)

    How comfortable am I with code? Currently, what you’re asking is a little over my pay grade! Let’s say I want to remove all the custom fields from the $my_post[‘post_content’], would I do something like this?

    $my_post[‘post_content’] = str_replace($customfields[$fieldname], ”, $my_post[‘post_content’] );

    Or would I do

    $my_post[‘post_content’] = str_replace($fieldcontent, ”, $my_post[‘post_content’] );

    Or what? (I must say I haven’t tried either of these yet.)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Remove custom field data from content area’ is closed to new replies.