• Resolved cousinr

    (@cousinr)


    I am creating a multivendor marketplace based on woocommerce and dokan. I want to prohibit sellers from adding links in long and short product descriptions.
    Is this solution suitable for my problem?

    //Disallow Vendors from adding links to their websites or URLs in the Product Description
    if( !is_admin() ) // not admin side
        add_filter( 'the_content', 'filter_the_content_in_the_main_loop' );
    function filter_the_content_in_the_main_loop( $content ) {
        if ( ! is_product() ) {
            $content = preg_replace(array('"<a>"', '"</a>"'), array(","), $content);
        }
        
        return $content;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Mirko P.

    (@rainfallnixfig)

    Hello @cousinr

    Have you already tested your custom-coded solution? In general, we do not provide support for custom coding on these forums, but I’m going to leave this thread open for a bit to see if anyone can take a look at the code and confirm it will prevent from adding links in the long and short product descriptions.

    You can also visit the WooCommerce Facebook Community group or the #developers channel of the WooCommerce Community Slack.

    We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution and the above resources for developers were helpful. If you have further questions, please feel free to open a new topic.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Strip links from product descriptions’ is closed to new replies.