• Resolved cantonbecker

    (@cantonbecker)


    I have a wordpress site where a custom template processes urls like

    https://mysite.com/program/?id=424

    Yoast broke this functionality a few years ago, so I implemented the hack below to our functions.php file.

    However, one of the more recent updates breaks our work-around.

    How do I keep yoast from messing around with our ?get variables?

    /* YOAST SEO MODIFICATIONS */
    if (function_exists('is_plugin_active') && is_plugin_active('wordpress-seo/wp-seo.php')) {
    	// remove YOAST processing on the generic /program/?id=xxx page
    	add_action('template_redirect','remove_wpseo');
    	function remove_wpseo(){
    	    if ( is_page(35409)) {
    			$wp_thing = WPSEO_Frontend::get_instance();
    			remove_action('wp_head',array($wp_thing,'head'),1);
    	    }
    	}
    	
    	// do not let YOAST remove ?variables for our program pages 
    	add_filter( 'wpseo_opengraph_url', 'filter_wpseo_opengraph_url', 10, 1 ); 
    	
    	function filter_wpseo_opengraph_url( $wpseo_frontend ) { 
    		if (stristr($wpseo_frontend, '/program/')) {
    			$wpseo_frontend = "https://www.upaya.org" . $_SERVER[REQUEST_URI];
    		}
    	    return $wpseo_frontend; 
    	}; 
    }
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Suwash

    (@suascat_wp)

    @cantonbecker

    Unfortunately, there’s a difference between the support we can offer and the level of programming needed to change (core) features of our plugin. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code,?we cannot advise you on how to make such changes. And even though we cannot be of any assistance, you’re completely free to change anything in the plugin to better suit your needs.

    As much as we hate to say it, your question goes beyond the technical expertise of me and my colleagues on the Yoast support team. This means we can’t give you a solid answer to your question.

    But we don’t want to leave you empty-handed either, that’s why we’ve created our developer portal at developer.yoast.com. This has proven to be useful to many developers in the past, and hopefully will serve you well too.

    Sorry we can’t be of more help here.

    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to prevent yoast from stripping off ?get variables’ is closed to new replies.