Yoast SEO
[Plugin: WordPress SEO by Yoast] Custom Post Type error. (1 post)

  1. twisted1919
    Posted 4 years ago #

    Installed the seo plugin and after a few days created a new post type.
    Now when going to the archive for that custom post type i get:

    Notice: Undefined index: metakey-competition in /var/www/html/yyy/zzz/wp-content/plugins/wordpress-seo/frontend/class-frontend.php on line 482

    The fix is simple:

    // open class-frontend.php at line 482 and look for:
    if ( !$metakey || empty($metakey) ) {
    $metakey = wpseo_replace_vars($options['metakey-'.$post->post_type], (array) $post );

    and change it with

    if ( (!$metakey || empty($metakey)) && isset($options['metakey-'.$post->post_type]) ) {
    $metakey = wpseo_replace_vars($options['metakey-'.$post->post_type], (array) $post );


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic