I believe that the page title you are talking about is the title from the page from the main query. the_title()
filter (and the_content()
filter for that matter) targets all the respective template tags regardless of query.
To avoid this, target only the main query and the specific page.
You can try the following inside your filter
if ( in_the_loop() && is_page( 'specific page' ) ) {
// Do what you need to do
}
EDIT
I just thought of this, haven’t tested it, but you can check your title inside the filter against a known static title and then do something according to that
Example:
if ( $title == 'My known title' ) {
// Do something with the title
}
Related Posts:
- Remove description from on Home
- Filter Widget Title Wrap
- Don’t replace “|” with Empty String (“”) when generating slugs from title
- Anyway to edit the titlebar of WordPress Widgets in the Admin area?
- Changing document title only on a custom page template
- Filtering ‘the_title’ with option to return subhead?
- wp_title() empty on a static front page
- Can’t change the title tag with wp_title filter
- Setting title using wp_title filter
- Add a Span Around a Product Title in WooCommerce [closed]
- Wrap h1-h6 in a div
- Variables in post title
- Is it possible to use multiple spaces in title?
- WP action/filter to modify title before header output and article output?
- Filter media upload attachment meta
- Use of comment_reply_link_args filter
- Filter page title (displayed in browser tab) of wp-login
- Strip $before & $after strings from a page title
- add_filter( ‘the_title’ gets through this if statement twice
- Filter Post Title without affecting screen-reader-text
- Modify WordPress Page Title ()
- How to filter page title for certain page?
- get_the_archive_title hook unwanted changes!
- Hide H1 Title using the_title filter
- Admin filter/error if post title is too long
- Auto append text after the title?
- Add custom options to the wplink dialog
- How to show page content in feed?
- Insert new element to array with add_filter
- remove_filter( ‘the_content’, ‘wpautop’ ); only for certain post types
- How can I add information underneath the user’s name on the users.php page?
- Is calling function_exists() faster or slower that apply_filters()
- Filtered query_vars becomes global. Why does this work?
- Can I add custom meta for each image uploaded via media-upload.php?
- I’m using a filter to remove the tags auto wrap, but there still wrapped elements?
- How to enable visual editor when editing comments on the dashboard?
- Format content value from DB outside of WordPress filters
- Can’t get wp_title filter working in twenty sixteen child theme
- add_action uses ‘echo’ add_filter uses ‘return’, why?
- Cron schedule interval through plugin options?
- wpmu_signup_user_notification filter not working
- Filter oembeds tags to modify iframe attributes
- How to check a filter are applied
- How do I add a listbox to the TinyMCE editor?
- How to remove google font in WordPress for only single page?
- Overwrite default WordPress wording
- Why anything done on comments_array hook gets reset?
- add filter login_redirect does not contain original requested redirect
- get_header and hook avoid normal call
- Dropdown filter in custom posts
- How to order by taxonomy using wp_query
- Filter taxonomy admin pagination
- Feed, RSS not able to clear the cache and cannot change the limit of cache life time
- Custom view counts not updating correctly
- WP Filter to change the URL of an Anchor wrapping the last gallery image
- Gutenberg – Add align controls to a custom block
- To add a custom filter based on a meta field
- I can not include page to wordpress function add_filter, the_content
- How to create Woocommerce Product Filter Widget [closed]
- Add default user field to WooCommerce checkout [closed]
- Filtering Comment Reply Links (comment_reply_link_args) for “infinite replies” in nested comments
- Create Search Form to Filter Through Terms
- Upload restrictions – upload_mimes – filter: Adding multiple MIMEs for a single extension and adding multiple extensions for a single MIME type?
- Filters on Login Page
- How to filter link?
- Conditional does not work with add_filter
- Pass debug_backtrace() in WordPress filter
- How to edit embed filter for youtube video to allow responsive full width layout
- Remove get_template_part() from custom theme
- How to access page variable inside action hook
- Shorten the title length
- Problem with Class, Filters and Callbacks
- Renaming wordpress login and get new password button
- preg_match() not working with post content
- Search a title word through query_posts (not the exact match)
- Parse a shortcode differently based on on what it’s nested in
- Elementor Image Hover + Filter Grid [closed]
- How to redirect template_directory to subdomain relativ url?
- How do I add tags to entire comments, not just their text
- Scanning for custom embed and prefetching
- How to exclude or include categories in wp rest API without query parameters?
- Remove and replace woocommerce add to cart button [closed]
- Replace a specific URL on all apperances on the Website (Maybe a filter?)
- How to add lazy field in content endpoint using Gutenberg blocks
- Modify Contextual Help
- how to use apply filter for Class?
- Modify WordPress search behaviour in backend?
- Re-order search results with posts_orderby filter and post meta value
- Set Microsoft Word links to open in new window/tab
- WordPress get_avatar filter to match logins
- ‘the_content’ Filter delivers empty string with lengh (608)
- Testing requested query in pre_get_posts
- Output dynamic_sidebar_params in wp_head
- How to sort posts according to meta value?
- Modify WooCommerce email shipping text value
- Change shortcode output (filter?)
- Using Filters To Change Page Title
- remove_filter excerpt_more from a plugin class
- Filter a custom post type by custom field in admin
- Search and Filter Using Custom Post Type, Custom Taxonomy, and Advanced Custom Fields