single_post_title only works on single posts, so you are okay using this. First thing you could try is changing “true” to “false” to make the title be returned in the title tag you’ve created. If that doesn’t fix it then try adding an h1 as below (which i don’t think you’ll need).
SEO is also looking for an H1 (title) tag i believe as well. If you enclose your single_post_title in an h1 tag it will eliminate your seo problem together with changing return output to false:
<h1><title>
<?php if ( is_single() ) {
single_post_title('', false);
} else {
bloginfo('name'); echo " - "; bloginfo('description');
}
?>
</title></h1>
The other option is to just use this:
<title><?php wp_title(''); ?></title>
Related Posts:
- Replace URL with Site Title in Search Results
- How to change tab’s title in search results pages? [closed]
- How to search titles/artist/album within a playlist, and only lists the results that match?
- How can I prevent the Search Results Page from changing title?
- Change the text “search result for” on search result page
- How can I implement a location based (zip code) search in WordPress?
- How to highlight search terms without plugin
- Template issues getting ajax search results
- Complex Search functionality. Advice needed
- How to use next_post_link and previous_post_link on single posts in search results
- Why is there a class=”screen-reader-text” on my search button?
- can’t limit search to only pages
- Include custom table into search results
- How to exclude post body from WP search
- ElasticPress Indexing multiple sites
- Search outside of the “loop”
- Include category title in wp_title
- Force WP to use a certain search template
- Do not allow to search certain words
- Display title for search engine visitors
- How to avoid the specific page while searching in WordPress without plugin?
- Best way to Integrate Google Search?
- Search query – exact post title match
- How to add additional search terms (e.g. synonyms) to the search?
- Combine internal search with Google custom search?
- Comparing between a negative and positive number
- Any reason why search result lists only one entry?
- Display just child pages of a certain page in search results
- How to make wordpress default search to woocommerce search
- pre_get_posts action: Search by post_title and post_content with different search phrase in the same query
- Why won’t is_search work inside functions.php?
- Woocommerce: How to remove page title from storefront theme homepage
- Search functionality – include date, category and author search
- WordPress Search matching hyphenated words
- How to stop WordPress Search form from searching only in current page?
- How can I make a search form that can search taxonomies and posts?
- How can I include author (their archive page) in search results?
- How to search media library alt text and title fields
- how to create search and filter form generating “plus” symbols in url in between category names?
- Meta query: How do I return posts within a date period from a given month?
- How to Change The Title in WordPress For SEO
- Creating a Searchable PDF Archive of Publications
- Display post titles that match string in post content
- Search – Only search for post meta field
- Search Form Based On Tutorial Not Working
- how to show Author information in search results
- How To Keep Search Title the same on paged Results
- Sitelinks Search box schema confusion
- Display Search Results after search 1st link
- Make archive page show up in search results?
- WordPress custom search by post type
- WP_User_Query not searching
- meta post search
- “Revision” records in wp_posts have original post type instead of “revision”
- Search engine for WP as CMS [closed]
- Why does this search.php not work?
- Breadcrumbs: Search result not displayed when static page is on top
- Can’t place two custom post types into the WordPress search query?
- Replacement search plugin that reads widgets or catalogs entire page?
- Rewrite wp function
- WordPress custom search only works from some pages
- WordPress search – Display the paragraph which has the searched word/term
- How to Fix Form elements do not have associated labels in WordPress Search Form (without button)
- Title tag on home using front-page template not showing
- Search to include external content
- Post title not displaying as recorded in the wp_posts table
- pulling in external JSON search results into WordPress
- long-title posts do not want published
- How to Integrate Live search in WordPress?
- How to create a custom filter in WordPress?
- search results in custom template search.php
- Please I want to prefix my WP posts title according to each category
- Search results are showing full page instead of sample
- customize search result in wordpress
- Highlight search words in excerpt
- $_GET value is losing it’s space
- limit the number of searches
- Search For Custom Post Type and Custom Fields
- Display tab title as ‘blog tagline | blog title’
- Searching on my blog is not working
- WP search in metadata post
- “Modular/reusable” content and search results
- Make the title and […] clickable in result search
- Add Search Form to Dropdown menu
- Search doesn’t work with ‘relation’ => ‘OR’
- Add meta tag to search results
- Searchform for searching specific categories
- Selectbox and Searchform and Custom Search Page
- Hightlight search-terms with functions does remove or disable other filters?
- wp_redirect and search engine bots
- SQL: Search query to get attachments only of those parents which are published
- Search redirects to index
- Want to creat a search for my wordpress theme [closed]
- Return 404 for /search/ queries – For Genesis
- Deprecating WordPress URL from Google, promoting custom domain [closed]
- Search with multiple selects that include tags
- Search results from a specific database table
- WordPress Search – Reject partial matches
- Need help to be able to searching by tag and title
- Wp query search built out of 4 terms?