Disable Smartcrawl on posts

Hi, I have a problem with Smartcrawl Pro. Its no new issue I had this problem with other SEO Plugins too already but I was able to just disable Meta for a specific Post Type.
The Problem is that Smartcrawl Pro gets the Meta Title and Description of the last Post that was queried on that Site -> My Structure is like this -> I have a Page and in that Page are Modules queried as Posts.

So, I need a hook or something to disable Meta for a Post Type or some other Fix or Workaround maybe.

  • Adam Czajczyk
    • Support Gorilla

    Hello Kuse.de GmbH

    I hope you're well today and thank you for your question!

    The SmartCrawl plugin hooks up to native WP hooks but it also includes quite a lot of it's own filter/action hooks so we've already passed your question to our developers, asking them to check if any of those could be used to achieve what you need.

    Please keep track of this ticket and we'll update you here as soon as we get more info on this from them.

    Best regards,
    Adam

  • Panos
    • SLS

    Hi Kuse.de GmbH !

    Not sure how well this will work on your side, but it's worth checking it out. You can add the following snippet in a mu-plugin:

    add_action( 'wp', function(){
    
    	$excluded_sc_pages = array( 'page-1', 'page-2' );
    
    	global $wp_filter;
    
    	if ( ! is_page( $excluded_sc_pages ) ) {
    		return;
    	}
    
    	$sc_hooks = array( 'wp_head', 'wp_title', 'pre_get_document_title' );
    
    	foreach ( $sc_hooks as $hook ) {
    
    		foreach ( $wp_filter[$hook]->callbacks as $key => $callback_array ) {
    
    			foreach (  $callback_array as $c_key => $callback ) {
    
    				if ( isset( $callback['function'] ) &&
    					! ( is_object( $callback['function'] ) && ( $callback['function'] instanceof Closure) ) &&
    					isset( $callback['function'][0] ) &&
    					$callback['function'][0] instanceof Smartcrawl_OnPage )
    				{
    
    					unset( $wp_filter[$hook]->callbacks[$key][$c_key] );
    				}
    			}
    		}
    	}
    
    }, 20 );

    This should unset the SmarCrawl's callbacks for those hooks for the specific pages set. You will need to set those pages in this line:
    $excluded_sc_pages = array( 'page-1', 'page-2' );
    separated by a comma. You can use page ids too if you prefer.

    In case you are not familiar with mu-plugins, you can create a php file, eg called sc_exclude_pages.php in the wp-content/mu-plugins folder. If that folder doesn't exists you can simply create it. Then open to edit that file and add the php opening tag at the very top <?php add new line (enter/command) and paste the snippet above.

    I would strongly suggest to first try it out in a staging/testing site.

    Hope this helps!

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.