Viewing 1 replies (of 1 total)
  • Hi, in which sitemaps does that plugin generate these URLs? Is that plugin available on www.remarpro.com so I could test?

    It depends on how that plugin creates these pages. Are they visible in your Pages list? In that case, try editing such a page and look for the XML Sitemap options section, usually on the bottom right. There will be an option to exclude the URL from the sitemap there.

    If that plugin creates these adresses differently, it might be more difficult to exclude them.

    There is the filter ‘xmlsf_excluded’ available which you might be able to use but you’ll have to be able to detect the address inside a normal WordPress loop. You might want to ask the plugin developers how to do that.

    It basically works like this:

    
    function exclude_from_sitemap( $exclude, $post_id ) {
        // find a way to know if we are currently serving a user registration URL
        // for example, that plugin might have a function like 
        // is_registration_page() which returns true, then you could use this:
        
        if ( function_exists( 'is_registration_page' ) && is_registration_page( $post_id ) ) {
            $exclude = true;
        }
    
        return $exclude;
    }
    
    add_filter( 'xmlsf_excluded', 'exclude_from_sitemap', 10, 2 );
    

    (this is just an example, it completely depends on the other plugin…)

Viewing 1 replies (of 1 total)
  • The topic ‘Remove non-existent url from sitemap’ is closed to new replies.