aioseo_keywords

Purpose

This filter can be used to filter the keywords.

Arguments (1)

  1. $keywords (string) – The list of keywords, comma-separated.

Example code snippet

The code snippet below is just an example of how this filter can be used. In the example below, another keyword is added to each post.

add_filter( 'aioseo_keywords', 'aioseo_filter_keywords' );

function aioseo_filter_keywords( $keywords ) {
   if ( is_singular() ) {
      $keywords = explode( ',', $keywords );
      array_push( $keywords, 'anotherkeyword' );
      $keywords = implode( ',', $keywords );
   }
   return $keywords ;
}