• Resolved josh.grisdale

    (@joshgrisdale)


    Hello,

    I want to change the meta description of certain pages via a function in my functions.php. Is there a hook to do this?

    ie

    add_filter( ‘SmartCrawl_metadesc’, ‘change_metadesc’ );

    function change_metadesc( $desc ) {

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @joshgrisdale

    I hope you are doing good today.

    I pinged our SmartCrawl Team to review your query. We will post an update here as soon as more information is available.

    Kind Regards,
    Kris

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @joshgrisdale

    I hope you are doing well.

    You can use:

    <?php
    
    add_filter( 'wds_metadesc', 'change_metadesc' );
    
    function change_metadesc( $description ) {
    
    	$description = 'Updated value, please apply the conditional before updating it';
    
    	return $description;
    
    }

    Best Regards
    Patrick Freitas

    Thread Starter josh.grisdale

    (@joshgrisdale)

    Amazing – thank you!

    Is there a similar hook for the image (ie og:image and twitter:image)?

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @joshgrisdale,

    You can try the following code:

    add_filter( 'wds_custom_og_image', function ( $images ) {
    	$image_url = 'Your URL here';
    
    	return array( $image_url => array( $image_url ) );
    } );
    
    add_filter('wds_custom_twitter_image', function( $image ) {
        $image_url = 'Your URL here';
    
    	return array( $image_url => array( $image_url ) );
    	});

    Kind Regards,
    Nebu John

    Thread Starter josh.grisdale

    (@joshgrisdale)

    Thank you very much!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Hook into Meta Data’ is closed to new replies.