Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @samwiel,

    This indeed gets rid of the HTML tags, but it seems it doesn’t ‘break down the lines/enters/br’s’. How to get this working properly?

    The wp_strip_all_tags() function has an optional second parameter to remove line breaks, which by default is set to “false”. So, to remove line breaks, you could use something like this:

    function my_clean_content( $content ) {
        return wp_strip_all_tags( $content, true );
    }
    Thread Starter samwiel

    (@samwiel)

    Hi support,

    Thanks for the reply. It fails the code if I try to execute. Could you help me a hand on this? I want to get rid of the HTML tags and the line breaks while exporting.

    Link to screenshot

    Thanks in advance.

    KR,
    Sam

    Plugin Author WP All Import

    (@wpallimport)

    @samwiel please try the function I posted above instead of the one in your screenshot.

    Thread Starter samwiel

    (@samwiel)

    Working like a charm! Thanks a bunch.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Delete empty lines after HTML removal in Export’ is closed to new replies.