Stopping spam links

hello,
On my site, in the listing content area, submitted hyperlinks are turned into plain text, and embedded links are is disabled. However spammers can put “https://cnn.com” and it is turned into a link. I would like to know if they can be turned into plain text, or disapeared

I think im missing the correct terms to do so. So far i have tried the following with no luck:

// Disable automatic link conversion for plain URLs in content
remove_filter( 'the_content', 'make_clickable', 9 );
remove_filter( 'the_excerpt', 'make_clickable' );

/////////////////////

// Disable automatic link conversion for plain URLs in content
remove_filter( 'the_content', 'make_clickable', 9 );
remove_filter( 'the_excerpt', 'make_clickable' );

// Add a custom function to handle specific class exclusion
function exclude_specific_classes_from_link_conversion( $content ) {
    // List of classes to exclude from link conversion
    $exclude_classes = array( 'hp-page__content', 'hp-listing__details', 'hp-listing__details--primary' );

    // Loop through each excluded class and prevent link conversion
    foreach ( $exclude_classes as $class ) {
        $content = preg_replace_callback(
            '/(<[^>]+)class=[\'"]' . preg_quote( $class, '/' ) . '[\'"]([^>]*>)/i',
            function ( $matches ) {
                return $matches[1] . 'data-no-link-conversion' . $matches[2];
            },
            $content
        );
    }

    return $content;
}

add_filter( 'the_content', 'exclude_specific_classes_from_link_conversion', 20 );
add_filter( 'the_excerpt', 'exclude_specific_classes_from_link_conversion', 20 );

/////////////////

function disable_specific_class_link_conversion( $content ) {
    // List of classes to exclude from link conversion
    $exclude_classes = array( 'hp-page__content', 'hp-listing__details', 'hp-listing__details--primary' );

    // Loop through each excluded class and prevent link conversion
    foreach ( $exclude_classes as $class ) {
        $content = preg_replace_callback(
            '/<a(.*?)class=[\'"]' . preg_quote( $class, '/' ) . '[\'"](.*?)>(.*?)<\/a>/i',
            function ( $matches ) {
                return '<span' . $matches[1] . 'class="' . $matches[2] . '">' . $matches[3] . '</span>';
            },
            $content
        );
    }

    return $content;
}

add_filter( 'the_content', 'disable_specific_class_link_conversion', 20 );
add_filter( 'the_excerpt', 'disable_specific_class_link_conversion', 20 );

//////

// Disable automatic link conversion for plain URLs in content
remove_filter( 'the_content', 'make_clickable', 9 );
remove_filter( 'the_excerpt', 'make_clickable' );

// Add a custom function to handle specific class exclusion
function exclude_specific_classes_from_link_conversion( $content ) {
    // List of classes to exclude from link conversion
    $exclude_classes = array( 'hp-page__content', 'hp-listing__details', 'hp-listing__details--primary' );

    // Loop through each excluded class and prevent link conversion
    foreach ( $exclude_classes as $class ) {
        $content = preg_replace_callback(
            '/(<[^>]+)class=[\'"]' . preg_quote( $class, '/' ) . '[\'"]([^>]*>)/i',
            function ( $matches ) {
                return $matches[1] . 'style="pointer-events: none; cursor: default;"' . $matches[2];
            },
            $content
        );
    }

    return $content;
}

add_filter( 'the_content', 'exclude_specific_classes_from_link_conversion', 20 );
add_filter( 'the_excerpt', 'exclude_specific_classes_from_link_conversion', 20 );

Hi,

If you mean listing description, then the easiest option is to overwrite the template parts’ using a child theme and make changes to the HTML there, please check this doc How to override template parts - HivePress Help Center

​I hope this is helpful to you.

Yes, i mean the listing description. it is wide open to spam. Even if they are nofollow, linking out to bad neighborhoods can effect rankings, alter a sites category, and can also make google filter a site from safe search. This issue will prevent a website from ever ranking wel. 24 hr moderation can be hard on larger sites, and if Hivepress has any footprints, the spamming can be automated. You guys have a really great product, it is exceptionally good, but the SEO of it needs attention, especially the ability to spam descriptions and improper use of header tags…IE: h2s in the footer widgets headers/improper hierarchy etc. . Anyhow, I dont want to alter the templates, as modifying the html in this way/ or the wrong way, can have security implications. A functions code would be the proper way to handle it. If you dont have any functions code, can you tell me if there any built in hooks or options that can allow me to control the link conversion more granularly, and or what classes can be targeted, as targeting “hp-listing__description” “hp-page__content” or “hp-listing__details” doesnt seem to work for me, im missing something, or hivepress is missing something.

Just to retiriate: Wordpress already strips hyper links, it will leave the anchor text on the page, i believe also it will not turn https//:URLs into hyperlinks. Nor will these show in the html. However, Hivepress, if a user does not hyperlink, and just writes “https://wordpress.com” it is then turned into a hyper link, which will invite spammers and effect rankings. i would like to aviod that using a functions code. The classes im targeting dont seem to help. Thanks

this:“remove_filter( ‘the_content’, ‘make_clickable’, 9 );” and trying hp-listing__description” “hp-page__content” or “hp-listing__details doesnt work either