How can I remove my download post from website search results.

in Download Manager Free

Viewing 6 posts - 1 through 6 (of 6 total)
Mar 20, 2020 at 5:59 pm
#122517
Participant
Afique X
OP

example

How can I remove the download posts from my search result which is shown above?

You can also check the issue here: https://courseportals.com/?s=gordon+ramsay

  • This topic was modified 5 years, 11 months ago by Afique X.
Mar 23, 2020 at 8:54 am
#122656
Moderator
Nayeem Riddhi
Staff

Hi,

Please add the following code at the end of your active theme’s functions.php

function noindex_for_wpdm()
{
    if ( is_singular( 'wpdmpro' ) ) {
        echo '<meta name="robots" content="noindex, nofollow">';
    }
}

add_action('wp_head', 'noindex_for_wpdm');

I hope, it will help you.

Thanks.

Mar 31, 2020 at 9:41 pm
#123167
Participant
Afique X
OP

It’s not working! I think you didn’t understand my problem. Although I want this want to happen which is excluding my download posts from google search I also want to remove download posts from my internal site search. So that people don’t see the download posts when they search inside my website.

Apr 9, 2020 at 10:19 am
#125530
Moderator
Nayeem Riddhi
Staff

OK, if you want to exclude download posts in the search result in your site, please put below code in your theme functions.php,

add_action( 'init', 'wpdm_custom_type', 99 );
function wpdm_custom_type() {
    global $wp_post_types;
    if ( post_type_exists( 'wpdmpro' ) ) {
        $wp_post_types['wpdmpro']->exclude_from_search = true;
    }
}

Thanks, sorry for some late.

Jan 6, 2021 at 5:37 pm
#144143
Participant
Duncan
This reply has been marked as private.
Jan 9, 2021 at 3:48 pm
#144285
Moderator
Nayeem Riddhi
Staff

Thank you, we shall try it

Viewing 6 posts - 1 through 6 (of 6 total)

The topic "How can I remove my download post from website search results." is closed to new replies.