Homepage Title "page not found" issue

#7233
  • Resolved Shariful Islam
    Rank Math free

    Homepage Title “page not found” issue with https://www.elegantthemes.com/gallery/extra/ themes. When I deactivate the Rank Math Seo plugin, the problem was fixed.

    I fixed the problem by using the below code:

    /**
    * Only load if Rank Math plugin is activated
    */
    if ( defined('RANK_MATH_FILE' ) && 'layout' === get_option('show_on_front') ) {
    
    /**
    * Adjusting homepageā€™s title tag
    * @return string
    */
    function extra_rank_math_homepage_title_adjustment( $title ) {
    if ( is_home() ) {
    $title = RankMath\Helper::replace_vars( RankMath\Helper::get_settings('titles.homepage_title') );
    }
    return $title;
    }
    add_filter('rank_math/frontend/title', 'extra_rank_math_homepage_title_adjustment', 16 );
    
    /**
    * Adjusting homepageā€™s meta description
    * @return string
    */
    add_filter( 'rank_math/frontend/description', function( $description ) {
    if ( is_home() ) {
    $description = RankMath\Helper::replace_vars( RankMath\Helper::get_settings( 'titles.homepage_description' ) );
    }
    return $description;
    });
    
    /**
    * Adjusting homepageā€™s robots
    * @return string
    */
    add_filter( 'rank_math/frontend/robots', function( $robots ) {
    if ( is_home() ) {
    $robots = RankMath\Helper::get_settings( 'titles.homepage_robots' );
    if ( ! is_array( $robots ) || ! in_array( 'noindex', $robots ) ) {
    $robots['index'] = 'index';
    }
    if ( ! is_array( $robots ) || ! in_array('nofollow', $robots ) ) {
    $robots['follow'] = 'follow';
    }
    }
    return $robots;
    });
    }

    But I have many sites running on the extra theme and I want wanna add these code manually. there will be an update regarding this problem in the future?

Viewing 1 replies (of 1 total)
  • Todd
    Rank Math free

    Hello,

    Thanks a lot for your query and we are so sorry about the trouble this must have caused.

    Please head over to WordPress Dashboard > Settings > Reading and select one of the options for your homepage.

    This issue will vanish after that.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Homepage Title "page not found" issue’ is closed to new replies.