Last active
April 16, 2021 01:17
-
-
Save strangerstudios/bebfba496e73bdfd29de to your computer and use it in GitHub Desktop.
Add level name to membership checkout <title> attribute for 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
//add level name to membership checkout <title> attribute for SEO | |
function my_pmpro_membership_checkout_head_title($title, $sep) | |
{ | |
global $pmpro_pages; | |
if(!empty($pmpro_pages) && is_page($pmpro_pages['checkout'])) | |
{ | |
global $pmpro_level; | |
$title = $pmpro_level->name . " " . $sep . " " . $title; | |
} | |
return $title; | |
} | |
add_filter( 'wp_title', 'my_pmpro_membership_checkout_head_title', 20, 2 ); |
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 "Add Level Name to Membership Checkout Page Title for SEO" at Paid Memberships Pro here: https://www.paidmembershipspro.com/add-level-name-to-membership-checkout-page-title-for-seo/