Jump to content

Adding a meta description tag to the WordPress homepage


Alejandro

Recommended Posts

WordPress doesn't have built-in functionality to add meta tags to pages. If you have setup a static homepage using a WordPress page there's no simple way to add a meta description to this page without installing a 3rd party plugin. In this case you can add the code below to the iReview theme functions.php file to easily add the meta description tag to the homepage without the need for extra plugins.

function homepage_meta_description()
{
    if ( is_front_page() ):?>

        <meta name="description" content="Meta description text here" />

    <?php endif;
}

add_action( 'wp_head', 'homepage_meta_description' );
  • Like 1
Link to comment
×
×
  • Create New...