• Resolved BIFOCAL

    (@bifocal)


    I have a site where the canonical link needs to be different from the og:url link (Facebook is grabbing comments from the canonical link, hosted on a different website, and it needs to grab them from the site SEO Framework is on.

    Is there a way to filter the og:url in order to make it be the permalink?

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

    (@cybr)

    Hello!

    Yes, you can use this filter: the_seo_framework_ogurl_output.

    Example:

    add_filter( 'the_seo_framework_ogurl_output', function( $url, $id ) {
    	
    	if ( is_singular() ) {
    		// Change singular URL here.
    	} else {
    		// Change term/taxonomy URL here.
    	}
    
    	return $url;
    }, 10, 2 );
    Thread Starter BIFOCAL

    (@bifocal)

    Yes! Beautiful! That did it, thank you so much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filter to specify a custom og:url?’ is closed to new replies.