You may consider the use of both filter wpseo_metadesc
(for meta description) and wpseo_title
(for title). The idea is to change the values of title and/or description depending if you meet some condition.
So your code will look to somthing like this:
add_filter('wpseo_metadesc','custom_meta');
function custom_meta( $desc ){
if (/* do your test here to check template or any other values*/) {
$desc = "Change the description";
}
return $desc;
}
add_filter('wpseo_title','custom_title');
function custom_title( $title ){
if (/* do your test here to check template or any other values*/) {
$title = "Change the title";
}
return $title;
}
You can for example consider the function is_page_template() for your test.
Related Posts:
- Is it okay to use page template as contact page? [closed]
- Show Yoast SEO meta tags in Custom WordPress Templates (Theme)
- Password protected posts redirects
- Variable use in get_template_part
- Overriding page template using page_template filter
- Dynamically assign same page template to child page as parent
- What content should go in index.php?
- How to show a post single post in page template
- How to pass a numeric id to a page template?
- Create a new template for twentytwelve
- Posts archive index pagination in a static page custom query
- is_page_template & is_page in functions.php not working
- Why is POST’ing to my WP page template producing a 404?
- get page title, url and excerpt of a page
- Theme’s page.php and index.php template files are confusing me
- Grabbing the page template name?
- Use is_category(), is_tag(), … in functions.php
- Why am I getting syntax error, unexpected ‘endwhile’ (T_ENDWHILE) in this template? [closed]
- How to handle a missing page.php?
- Customize edit.php Pages listing in dashboard to show only pages with a particular template applied?
- Remove all theme CSS & JS from wp_head (but only for 1 page template)
- remove page template from dropdown?
- Export csv and force download in template page
- WPML in custom page templates
- Why (and how?) is get_header() erasing all my stuff?
- WordPress can’t find IXR_Client
- page.php not displaying content
- Creating a custom archive template that sorts post by date
- Pre get posts where template is not equal to one specified?
- alt tags of the images are not saving/emtpy
- Only show content if current page is NOT one of 2 page templates [closed]
- How to make text show up – new page template
- Adding general page content to page templates
- How to Change The Title in WordPress For SEO
- Content pulled from page template instead of editor
- SuperCache for Custom Templates
- WordPress thinks my custom taxonomy pages are search pages #seo
- Page template without header & footer
- WordPress showing 404 page template for unpublished posts
- Facebook og:image issues after https change [closed]
- !is_page_template not working with && operator
- Is there a way to create a template that does not have the site styling associated with it?
- WordPress 3.3.1 Page template not showing in admin area
- wp-cli for Creating page-template
- Want to exclude slider from page.php in header
- Yoast Force Rewrite Crashed Site [closed]
- changing background color depending on parent page
- Can i forget about the post loop inside the page template?
- Yoast primary category query modification
- Display ACF if parent page has specific template
- Adding a H1 Tag to Post Tags automatically, but hide the tag? (Same for Category)
- How to remove WordPress Virtual Robots.txt that keeps overriding my root robots.txt? [closed]
- Creating page & post templates without template file
- Does get_template_part() content gets parsed if it’s not executed?
- Get_template_part seems to be ignoring my template
- Function to load correct CSS for Template not working
- Change page template programmatically inside foreach
- How can I correctly redirect user to the submitted post and define a template for each new post in WordPress?
- Setting up robots.txt with Yoast’s Seo plugin
- Find php file anywhere in folder and subfolder from template
- Workaround for og:image unsupported webp image type, Yoast SEO?
- different sidebars depending on template (is_page_template is not working)
- Does anyone know why my SEO and title become one?
- WordPress page template to show posts as per category dynamically
- Permalink not changing according to post type
- page.php template file render a core gutenberg component programmatically
- 301 redirects after changing permalinks
- How to display the contents of URL1 when user visits URL2
- How to require specific PHP files for specific templates
- send page ID’s to another template
- Restrict Access to Logged-In Users Page Template
- Converted HTML5 to WP, How to apply converted classes to new pages (after conversion completed)
- Is there a universal slug for static homepage?
- Target pages using Woo Commerce single product page template
- require happens out of order
- What is the best way to manage pages content?
- how to get the title, description, pictures on the page?
- Show all images attached to posts as a gallery page?
- Page Template CSS file not loading
- Custom templates stopped working
- Adding secondary featured image for page_for_posts
- .htaccess help to a beginner
- Decision about page templates for static pages
- Loading custom page template on a one page website
- Special 404 header page
- Custom page Template and Script as a Plugin
- Setting Custom WordPress “Posts page” AS “Front page”
- Why do some pages on my site use the previous theme?
- How to move from page template to page template
- Recents posts pulling from different post type
- Template tag for /page/# structure
- Videopress Short Tags not working when pulling page into template
- Utilizing the template hierarchy while storing page templates in a subdirectory
- Add a title to ACF form from frontend
- Enabling canonical links to force search engines to go to site.com rather than site.net [closed]
- How do I create a page template that doesn’t show URL, sidebar, nav menu, footer?
- Possible to change meta data single quotes to dobule quotes in yoast wordpress seo? [closed]
- Custom page template not working on mobile
- seo meta description issue in google search
- Extra HTML code added to my (on Chrome DevTools) but not on source code