Home / Admin / Change Twitter Title for a Specific Post
Duplicate Snippet

Embed Snippet on Your Site

Change Twitter Title for a Specific Post

This filter can be used to Change the Twitter Title for a Specific Post.

You can replace '14' with the Post ID.

<10
Code Preview
php
<?php
add_filter( 'aioseo_twitter_tags', 'aioseo_filter_twitter_title' );
function aioseo_filter_twitter_title( $twitterMeta ) {
   if ( is_singular() && '14' === get_the_ID() ) {
      $twitterMeta['twitter:title'] = "A different title";
   }
   return $twitterMeta;
}

Comments

Add a Comment