Front-End & Daily

How to turn off title tag output in All in One SEO

How to turn off title tag output in All in One SEO

Here's how to turn off title tag output in the WordPress SEO plugin "All in One SEO (AIOSEO)".

Conclusion

We use a filter hook.

Paste this into functions.php.

// Turn off title tag
add_filter( 'aioseo_disable_title_rewrites', 'aioseo_disable_term_title_rewrites' );
function aioseo_disable_term_title_rewrites( $disabled ) {
	return true;
}

This will prevent the title tag from being output on all pages.

To turn off the title tag only on specific pages, such as "posts and static pages only", do this:

// Turn off title tag
add_filter( 'aioseo_disable_title_rewrites', 'aioseo_disable_term_title_rewrites' );
function aioseo_disable_term_title_rewrites( $disabled ) {
	if ( is_single() || is_page() ) { // Only for post pages and static pages
		return true;
	}
	return false;
}

Just check the page where you want to turn off the title tag and return true.

Official documentation here

aioseo_disable_title_rewrites - AIOSEO

By the way, if you want to do the same for descriptions, see here:

Related to this, here's how to deal with the problem of an empty title tag being output on 404 pages:

All in One SEOで404ページのtitleタグを変更する方法

How to change the title tag of 404 pages in All in One SEO

What was happening

In All in One SEO settings, you can bulk set title tags, but

All in One SEO Settings

If you have written the title tag directly in your theme or are outputting it with another plugin,

Even if you do this...

<head>
	<meta charset="utf-8">
	<title><?php wp_title(''); ?></title>
	<meta name="description" content="記事の説明">
	(省略)
</head>

The title tag will be overwritten by AIOSEO like this.

<head>
	<meta charset="utf-8">
	<meta name="description" content="記事の説明">

	<!-- All in One SEO 4.X -->
	<title>Article Title - Site Title</title>
	<meta name="description" content="AIOSEO default will include the introductory text of the article">
	<!-- All in One SEO -->
	(省略)
</head>

Therefore, this was a method to prevent All in One SEO from outputting title tags on specific pages.

Comments

After reviewing the content, we will publish it, omitting personal information.

Enter your name and email address too

Please enter if you would like a reply by email.

The personal information provided will not be disclosed. It will only be used for replies.

It will be sent directly. Please confirm and "Send".

If this was helpful, we appreciate your support!
Any support received will be used for childcare.

OFUSEで応援を送る


Or support us by buying something from the buttons below
(You don't have to buy the linked product.)

Amazon

楽天市場

Yahoo!ショッピング

PR

As an Amazon Associate, "Ken" earns income from qualifying sales.

Share

Twitterでシェア Facebookでシェア LINEでシェア はてなブックマークでシェア