How to Use Yoast SEO Plugin in WordPress (Video Included)

Yoast SEO Tutorials

Whether you love or hate Yoast SEO plugin, its popular. Although over the years its become very bloated, it still offers quick and easy use of important features such as XML functionality and ability to edit URL Title and Meta Description.

RankYa Functions for Extending Yoast for Higher Google Ranking

function rankya_get_the_title( $post = 0 ) {
$post = get_post( $post );
$title = isset( $post->post_title ) ? $post->post_title : '';
$id = isset( $post->ID ) ? $post->ID : 0;
if ( ! is_admin() ) {
if ( ! empty( $post->post_password ) ) {
$protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ), $post );
$title = sprintf( $protected_title_format, $title );
} elseif ( isset( $post->post_status ) && 'private' == $post->post_status ) {
$private_title_format = apply_filters( 'private_title_format', __( 'Private: %s' ), $post );
$title = sprintf( $private_title_format, $title );
}
}
return apply_filters( 'the_title', $title, $id );
}
function rankyaseomastery(){
$rankyaposttitle = rankya_get_the_title();
$rankyaposttitle = '<h2>'.$rankyaposttitle.'</h2>';
$rankyacustomkeywords = "<p style='margin-left:.85em;margin-right:.85em;'>Thank you for sharing this blog post. Description: ". get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true) ."</p>";
return $rankyaposttitle . $rankyacustomkeywords;
}
add_shortcode('insertrankyaseomastery','rankyaseomastery');

SEO Tutorial by RankYa – Includes How to Use Yoast SEO Function

SEO Lessons for Beginners

What Does the Above Codes Do?

It allows you to show Yoast SEO Title & Meta Description on the frontend (giving your website higher precision of keyword targeting).

Where does the above code go? You can backup your Theme functions.php file and place it anywhere in functions.php

Then use the WordPress shortcode to insert meta description (perhaps footer or sidebar) by simply using WordPress shortcode using this format [insertrankyaseomastery]

By RankYa

RankYa, 100% Australian based content creator and digital services provider. An experienced technical problem solver, Google products expert and WordPress & Shopify optimization specialist dedicated to helping small businesses and online entrepreneurs succeed online.I’ve spent 10,000 hours mastering the digital landscape so you don't have to. Get the insights, skip the errors.

1 comment

Questions? Leave a Comment!

Your email address will not be published. Required fields are marked *