Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active April 13, 2021 17:57
Show Gist options
  • Save strangerstudios/6c75c90d81ba04388d0a to your computer and use it in GitHub Desktop.
Save strangerstudios/6c75c90d81ba04388d0a to your computer and use it in GitHub Desktop.
Filter the Membership Checkout wp_title using Yoast SEO.
<?php
//Update line 6 below to your preferred dynamic page title
function my_pmpro_filter_wpseo_title($title) {
global $pmpro_pages, $pmpro_level;
if( is_page($pmpro_pages['checkout']) ) {
$title = $pmpro_level->name . ': Complete Your Membership Checkout';
}
return $title;
}
add_filter('wpseo_title', 'my_pmpro_filter_wpseo_title');
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Dynamically Filter Membership Checkout Page Title and Meta Description Using Yoast SEO" at Paid Memberships Pro here: https://www.paidmembershipspro.com/dynamically-filter-membership-checkout-page-wp_title-meta-description-using-yoast-seo/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment