• Resolved PreMadeWeb

    (@premadeweb)


    Hello, some pages of my site have Untitled title because of your plugin. I have already reported you this error 10 months ago and you fixed it with this code:

    add_action( 'parse_request', function( $wp ) {
    
    	// Add any page you wish to exlude here on a new line; use * as a wildcard.
    	$pages_to_exclude = [
    		'buy-points',
    		'profile/*',
    	];
    
    	if ( ! is_admin() && isset( $wp->request ) ) {
    		if ( preg_match( '#^' . str_replace( '*', '.*?', implode( '|', $pages_to_exclude ) ) . '$#i', $wp->request ) ) {
    			add_filter( 'the_seo_framework_post_type_disabled', '__return_true' );
    		}
    	}
    } );

    But this solution doesn’t work anymore. Could you please help me to solve this issue once again?
    Thank you.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello again!

    I think this updated snippet will help. It runs a bit later, which might just do the trick. I also took the liberty to exclude the custom search queries, and updated the filter for improved v4.0+ support:

    add_action( 'wp', function( $wp ) {
    
    	// Add any page you wish to exlude here on a new line; use * as a wildcard.
    	$pages_to_exclude = [
    		'buy-points',
    		'profile/*',
    		'search/*',
    	];
    
    	if ( ! is_admin() && isset( $wp->request ) ) {
    		if ( preg_match( '#^' . str_replace( '*', '.*?', implode( '|', $pages_to_exclude ) ) . '$#i', $wp->request ) ) {
    			add_filter( 'the_seo_framework_query_supports_seo', '__return_false' );
    		}
    	}
    } );
    

    Have you escalated this issue with the developers of those pages yet–I believe it was 2codeThemes? We’re dealing with non-standard non-registered pages, so TSF can’t communicate via the WordPress API with them. Ultimately, the solution has to come from their side.

    In any case, I hope this temporary workaround works yet again. Cheers!

    Thread Starter PreMadeWeb

    (@premadeweb)

    Hello, your new solution works perfectly well.
    You are absolutely right, the developer is 2code Themes. I tried to contact them in the first time but they were not eager to help.
    Thank you for your quick help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Untitled title on some pages’ is closed to new replies.