Last active
April 13, 2021 17:57
-
-
Save strangerstudios/6c75c90d81ba04388d0a to your computer and use it in GitHub Desktop.
Filter the Membership Checkout wp_title using Yoast SEO.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/