Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 14th, 2014, 02:16 PM
redspan redspan is offline
 
Join Date: Feb 2009
Posts: 83
Question WP Yoast SEO - how to remove description?

Store ID:
Website URL: http://www.myvintageclothing.co.uk
URL to page in question: http://www.myvintageclothing.co.uk/s...swing-dresses/


Hi,

On any category or product page, if I view the source code I can see the correct title, but the first meta description tag is the same description as the store homepage.

Then, further down the source code, is the correct meta description and meta keywords (some are missing because I haven't written them yet, but the code is there). My concern is that Google will see the Yoast duplicate description first and ignore the true description further down.

How do I ensure that the Yoast meta description for the homepage is removed from all other pages?

Thanks

Last edited by redspan : January 14th, 2014 at 02:17 PM. Reason: More info
  #2  
Old January 14th, 2014, 02:51 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi,

Here's the code you need to remove / disable / override the Yoast WordPress SEO generated <title> tags, canonical links, meta description and meta keywords on all Datafeedr store pages.

This should be placed in your theme's functions.php file.

Hope this helps:

PHP Code:
/**
 * This removes the Yoast Wordpress SEO plugin generated title on all Datafeedr store pages.
 */
add_action'init''dfr_remove_wpseo_title' );  
function 
dfr_remove_wpseo_title$title ) { 
    global 
$wpseo_front
    if (
is_dfr()) { 
        
remove_filter('wp_title', array($wpseo_front'title'), 15); 
    } 
}

/**
 * This removes the Yoast Wordpress SEO plugin generated canonical links on all Datafeedr store pages.
 */
add_filter'wpseo_canonical''dfr_remove_wpseo_canonical' );  
function 
dfr_remove_wpseo_canonical$canonical ) { 
    if (
is_dfr()) { 
        
$canonical false
    } 
    return 
$canonical
}

/**
 * This removes the Yoast Wordpress SEO plugin generated meta description on all Datafeedr store pages.
 */
add_filter'wpseo_metadesc''dfr_remove_wpseo_metadesc' );
function 
dfr_remove_wpseo_metadesc$description ) { 
    if (
is_dfr()) {
        
$head $GLOBALS['DFR_PLUGIN']->shop_content->head;
        
preg_match('~<meta name="description" content="(.*?)"~'$head$output);
        
$description $output[1]; 
    } 
    return 
$description
}

/**
 * This removes the Yoast Wordpress SEO plugin generated meta keywords on all Datafeedr store pages.
 */
add_filter'wpseo_metakey''dfr_remove_wpseo_metakey' );
function 
dfr_remove_wpseo_metakey$keywords ) { 
    if (
is_dfr()) { 
        
$head $GLOBALS['DFR_PLUGIN']->shop_content->head;
        
preg_match('~<meta name="keywords" content="(.*?)"~'$head$output);
        
$description $output[1]; 
    } 
    return 
$keywords
}

/**
 * This gets the right title for product pages
 */
add_filter'wpseo_title''dfr_update_title' );  
function 
dfr_update_title$title ) { 
    if (
is_dfr()) {
        return 
$GLOBALS['DFR_PLUGIN']->shop_content->title ' ' get_bloginfo'name' );
    } 
    return 
$title;
}

/**
 * Gets the right OG title
 */
add_filter'wpseo_opengraph_title''dfr_opengraph_title' );
function 
dfr_opengraph_title$title ) {
    if (
is_dfr()) { 
        
$title $GLOBALS['DFR_PLUGIN']->shop_content->title;
    }
    return 
$title;


/**
 * Gets the right facebook image for product pages.
*/
add_filter'wpseo_opengraph_image''dfr_remove_og_image' );
function 
dfr_remove_og_image$image ) {
    if( !
is_dfr() ) {
        return 
$image;
    } else {
        if ( 
is_dfr('product') ) {
            
$head $GLOBALS['DFR_PLUGIN']->shop_content->head;
            
preg_match('~<meta property="og:image" content="(.*?)"~'$head$output);
                    
$image $output[1]; 
            return 
$image;
        }
    }

More Yoast WordPress SEO hooks (filters and actions) can be found here:
http://yoast.com/wordpress/seo/api/

Eric
  #3  
Old January 14th, 2014, 03:11 PM
redspan redspan is offline
 
Join Date: Feb 2009
Posts: 83
Default

Great! Thanks Eric
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
remove product description ferencszabo Questions 6 December 11th, 2011 10:41 AM
remove part of product description astran Questions 13 November 23rd, 2011 09:59 AM
Remove product description from related products? cashnow Questions 2 March 8th, 2011 10:26 AM


All times are GMT -5. The time now is 06:36 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.