Support » Plugin: Simple Facebook Connect » Disable Schema

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Samuel Wood (Otto)


    SFC does not have an option to do this. You can either use the sfc_meta filter to eliminate the meta SFC is creating, or disable the SEO plugin from creating that data.


    You mean I should remove the following lines?

    // add meta tags for *everything*
    function sfc_base_meta() {
    	$fbmeta = array();
    	$options = get_option('sfc_options');
    	// exclude bbPress post types
    	if ( function_exists('bbp_is_custom_post_type') && bbp_is_custom_post_type() ) return;
    	$excerpt = '';
    	if (is_singular()) {
    		global $wp_the_query;
    		if ( $id = $wp_the_query->get_queried_object_id() ) {
    			$post = get_post( $id );
    		// get the content from the main post on the page
    		$content = sfc_base_make_excerpt($post);
    		$title = get_the_title($post->ID);
    		$title = strip_tags($title);
    		$title = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
    		$title = htmlspecialchars_decode($title);
    		$permalink = get_permalink();
    		$fbmeta['og:type'] = 'article';
    		$fbmeta['og:title'] = esc_attr($title);
    		$fbmeta['og:url'] = esc_url($permalink);
    		$fbmeta['og:description'] = esc_attr($content);
    	} else { // non singular pages need images and descriptions too
    		if (!empty($options['default_image'])) {
    			$fbmeta['og:image'][] = $options['default_image'];
    		if (!empty($options['default_description'])) {
    			$fbmeta['og:description'] = esc_attr($options['default_description']);
    	if (is_home()) {
    		$fbmeta['og:type'] = 'blog';
    		$fbmeta['og:title'] = get_bloginfo("name");
    		$fbmeta['og:url'] = esc_url(get_bloginfo("url"));
    	// stuff on all pages
    	$fbmeta['og:site_name'] = get_bloginfo("name");
    	if (!empty($options["appid"])) $fbmeta['fb:app_id'] = esc_attr($options["appid"]);
    	$fbmeta['og:locale'] = sfc_get_locale();
    	$fbmeta = apply_filters('sfc_base_meta',$fbmeta, $post);
    	foreach ($fbmeta as $prop=>$content) {
    		if (is_array($content)) {
    			foreach ($content as $item) {
    				echo "<meta property='{$prop}' content='{$item}' />\n";
    				if ($prop == 'og:image') echo "<link rel='image_src' href='{$item}' />\n";
    		} else {
    			echo "<meta property='{$prop}' content='{$content}' />\n";
    			if ($prop == 'og:image') echo "<link rel='image_src' href='{$content}' />\n";


    add_settings_section('sfc_meta', __('Facebook Metadata', 'sfc'), 'sfc_meta_text', 'sfc');
    	add_settings_field('sfc_default_image', __('Default Image', 'sfc'), 'sfc_default_image', 'sfc', 'sfc_meta');
    	add_settings_field('sfc_default_description', __('Default Description', 'sfc'), 'sfc_default_description', 'sfc', 'sfc_meta');

    Is that so?


    Plugin Author Samuel Wood (Otto)


    No, you can just remove_action('wp_head','sfc_base_meta'); in your own code. Simpler.

    But, note that doing that will basically break the plugin. The results you get will not be optimal.

    Thanks Otto.

    For those using Yoast SEO Plugin and rather use your custom made excerpt, please add the following lines to your functions.php in your current theme.

    remove_action(‘wp_head’,’sfc_base_meta’); // Removes Simple Facebook Connect Meta
    remove_action(‘wp_head’,’sgc_base_meta’);// Removes Simple Google Connect Meta

    This way you can still use Otto plugins with WordPress SEO from Yoast.

    Plugin Author Samuel Wood (Otto)


    A better solution is to let SFC and SGC do their thing, and disable the OpenGraph functionality of the SEO plugin. SFC has been tuned to do this properly for Facebook and Google.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disable Schema’ is closed to new replies.