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)
- What does is_page_template() compare against?
- Creating custom blog page template the right way
- How To Create A Paginated List Of All Categories On My Site?
- is_page_template not working
- When is get_template_part() preferable to simply using the template.php files?
- How to remove all styles for certain page template?
- Password protected posts redirects
- Variable use in get_template_part
- Overriding page template using page_template filter
- Simplest way to add a second html editor to the post/page admin?
- How to consolidate multiple static page templates into one dynamic one?
- Loading page content into a variable in template
- Capturing arbitrary semantic URL arguments
- How do I display the text inside the WP editor for a page with a custom template?
- Dynamically assign same page template to child page as parent
- What content should go in index.php?
- Store Page Template Files in a Subfolder
- How to show a post single post in page template
- How to pass a numeric id to a page template?
- How can I dynamically load another page template to provide an alternate layout of the posts?
- Create a new template for twentytwelve
- get url page template
- Posts archive index pagination in a static page custom query
- Video Background – (php & css) – generating 404 error on page load – WordPress Theme File Structure Help
- How to remove a parent theme template from Quick Edit?
- How to Set a Custom Template for Blog Posts
- is_page_template & is_page in functions.php not working
- Removing or Restricting Access to Page Templates for Editor Role
- Created custom post type but selected template not staying selected
- Why is POST’ing to my WP page template producing a 404?
- get page title, url and excerpt of a page
- Can I create a page template, use it once, then hide/remove the option to use it again?
- Are page/post IDs unique across a whole network?
- Inserting Post Using wp_insert_post. How to Fill Yoast Plugin SEO Fields
- add post content in meta description in yoast
- Custom template for each page
- Theme’s page.php and index.php template files are confusing me
- Grabbing the page template name?
- SEO meta description and title tag Yoast SEO
- How can I have a static title on my blog page?
- Adding the Admin Bar to a page with a custom template
- Use is_category(), is_tag(), … in functions.php
- wp_title() handling of author page
- Can you call a template file without assigning template to a page in the admin panel?
- page-slug goes to not found
- Why am I getting syntax error, unexpected ‘endwhile’ (T_ENDWHILE) in this template? [closed]
- How do I add a body class to specific pages?
- How to edit 404 content via wp editor?
- How to list all titles of posts on a specific page?
- How to handle a missing page.php?
- Customize edit.php Pages listing in dashboard to show only pages with a particular template applied?
- Programatically switch page template?
- How to create a page template that retrieves content from db?
- Change path of the page’s template
- wp_redirect() does not work in custom template file
- Remove all theme CSS & JS from wp_head (but only for 1 page template)
- Get page id of current page from template [duplicate]
- is_page_template returning false
- remove page template from dropdown?
- Export csv and force download in template page
- WPML in custom page templates
- Programatically changing template of a page
- Can I change the contents of a description meta tag generated by Yoast?
- Why (and how?) is get_header() erasing all my stuff?
- get_pages — parent vs child_of?
- WordPress can’t find IXR_Client
- How to pass outside function to WP_REST_Request
- Creating a new page template
- Set different Canonical url programmatically for every post
- page.php not displaying content
- Unexpected results with conditionals inside template part
- Excerpts for Pages
- Visual Editor Templates
- Creating a custom archive template that sorts post by date
- Pre get posts where template is not equal to one specified?
- Change content of page in child theme using plugin
- Can two custom templates be used to create a single page?
- Use the_title_attribute() for the WHERE parameter in a page template
- alt tags of the images are not saving/emtpy
- WP-CLI not setting page template with page_template=”template-name.php”
- Find the page template of the previous page
- robots.txt Not Updating
- Create a page template with No Footer
- How to check if a specific page uses a page template?
- Only show content if current page is NOT one of 2 page templates [closed]
- How to solve Robots.txt problem with WordPress fresh install?
- Conditional get template part
- Register/Get sidebar?
- How to make text show up – new page template
- Yoast SEO: title tags are repeating my website name and slogan [closed]
- Cant remove line that appears above page content
- Adding general page content to page templates
- using the loop with a custom table
- Overwrite YoastSEO meta-tags with another page’s [closed]
- Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme [closed]
- How to ensure that a landing page created with WordPress does not enter the sitemap?
- Verify if the current page has at least one published child
- Create Dynamic SEO Friendly URL for Virtual Page