WordPressにおけるrel="noopener "の
意味を不思議に思ったことはありませんか?
新しいタブで開くリンクを追加すると、WordPressは自動的にそのリンクにrel="noopener "
属性を追加します。
この投稿では、WordPressにおけるrel="noopener "の
意味と、サイトへの影響について説明します。
WordPressのrel=”noopener “とは?
WordPressサイトにリンクを追加する場合、HTML属性を使用してリンクをクリックしたときの動作をコントロールすることができます。
例えば、リンクを作成する際、新しいタブで開くかどうかのトグルスイッチがある。
WordPressがこのリンク用に生成したHTMLコードは次のようになる:
<a href="http://example.com" target="_blank" rel="noreferrer noopener">external link</a>
リンクにrel="noopener "
とrel="noreferrer "
というHTML属性が追加されていることに注目してください。これらの属性は、セキュリティの脆弱性に対処するために追加されています。
問題は、JavaScriptのコードを使用して、新しいタブが参照ウィンドウをコントロールできるようになることです。悪意のあるコードに影響された外部サイトにリンクした場合、そのサイトはJavaScriptのwindow.opener
プロパティを使用して、(WordPressサイト上の)元のウェブページを変更し、情報を盗んだり、悪意のあるコードを広めたりすることができます。
WordPressはrel="noopener "
を追加することで、新規タブがこのJavaScriptの機能を利用することを防ぎます。同様に、rel="noreferrer"
属性はリファラー情報を新しいタブに渡さないようにします。
rel=”noopener “はWordPressのSEOにどう影響するか?
そんなことはない。
rel="noopener "
属性はWordPressサイトのセキュリティを向上させるとはいえ、WordPressのSEOに影響すると考えて使用を避けるユーザーもいます。
しかし、それは神話にすぎない。
サイトのSEOランキングや WordPress全体のパフォーマンスには影響しません。
noopener」と「nofollow」の違いとは?
rel="noopener "
とrel="nofollow "
を混同しがちです。しかし、これらは全く別の属性です。
noopener
属性はクロスサイトハッキングを防ぎ、WordPressのセキュリティを向上させます。
一方、nofollow
属性は、あなたのサイトがリンク先のサイトにSEOリンクジュースを渡すことを防ぎます。
検索エンジンは、あなたのサイトのリンクをたどるときにnofollow
属性を探し、考慮します。しかし、noopener
タグは考慮されません。
WordPressの初期設定では、外部リンクにnofollowを
付ける権限がありません。WordPressでnofollowを
追加したい場合は、プラグインを使用する必要があります。
さらに詳しく知りたい方は、WordPressでリンクにタイトルとnofollowを追加する方法の投稿をご覧ください。
rel=”noreferrer “はWordPressのアフィリエイトリンクに影響するか?
rel="noreferrer "
はWordPressのアフィリエイトリンクには影響しません。一部のユーザーは、rel=”noreferrer"
がリファラー情報を新しいタブに渡さないようにするためだと信じています。
しかし、ほとんどのアフィリエイト・プログラムは、あなたのアフィリエイトIDを持つ固有のURLを提供します。つまり、あなたのアフィリエイトIDは、他のサイトがトラッキングするためのURLパラメータとして渡されます。
第二に、ほとんどのアフィリエイト・マーケターは、アフィリエイト・リンクにリンククローキング・プラグインを使っている。
リンククローキングでは、ユーザーがクリックするアフィリエイトリンクは、実際にはあなたのサイト自身のURLであり、ユーザーを目的地のURLにリダイレクトします。
WordPressでrel=”noopener “を無効化するには?
サイトのリンクからrel="noopener "
を削除する必要はありません。rel=”noopener “はあなたのサイトのセキュリティに役立ち、パフォーマンスやSEOにも影響しません。
しかし、どうしても削除したい場合は、WordPressのGutenbergブロックエディターを無効化し、クラシックエディターを使用する必要があります。
なぜなら、手動でリンクからrel="noopener "
を削除しても、ブロックエディターが自動的にrel="noopener
“を追加し、サイトを安全に保つからです。
ブロックエディターを無効化したら、テーマのfunctions.phpファイルまたはWPCodeプラグイン(推奨)にコードスニペットを追加する必要があります。WPCodeフリープラグインの使い方は、WordPressでカスタマイザーコードを簡単に追加する方法をご覧ください。
以下のコードを新しいPHPスニペットにコピーするだけです:
add_filter('tiny_mce_before_init','wpb_disable_noopener');
function wpb_disable_noopener( $mceInit ) {
$mceInit['allow_unsafe_link_target']=true;
return $mceInit;
}
本当に〜してもよいですか?’Active’トグルをオンにして、’Save Snippet’ボタンをクリックします。
これでWordPressが新規リンクにrel="noopener "
を追加しないようになります。また、古いリンクを手動で編集して属性を削除する必要があります。
WordPressでリンクに追加するrel属性をもっとコントロールしたいですか?AIOSEOプラグインを使えば、WordPressエディター上でtitle、nofollow、その他のリンク属性を追加することができます。
WordPressでリンクを使うためのエキスパートガイド
rel="noopener "の
意味がお分かりいただけたと思いますので、WordPressでのリンクの使い方について、他のガイドもご覧ください。
- WordPressでリンクを追加する初心者ガイド
- WordPressで外部リンクを新しいウィンドウやタブで開く方法
- WordPressでNofollowリンクを追加する方法(初心者向け簡単ガイド)
- WordPressのリンク挿入ポップアップにタイトルとNoFollowを追加する方法
- WordPressで外部リンクをすべてNofollowにする方法
- WordPressでリンククリックとボタンクリックをトラッキングする方法(簡単な方法)
- WordPressでアウトバウンドリンクをトラッキングする方法
- WordPressでリンクの色を変更する方法(初心者ガイド)
- SEOのための内部リンク:ベストプラクティスの究極ガイド
- WordPressでリンクのプリロードを高速化する方法
- WordPressでリンク切れを見つけ、修正する方法(ステップバイステップ)
- WordPressのベスト内部リンクプラグイン(自動+手動)
WordPressのrel="noopener "
について、この投稿がお役に立てば幸いです。また、無料メールドメインの取得方法や、WordPressのSEOプラグインとツールのエキスパートによるベストセレクションもご覧ください。
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Moinuddin Waheed says
This is very helpful guide for me as I have been teaching html and css to my students and this for have not talked about these two attributes. Most of the teachers only bother to tell target equals blank attribute for opening link in new tabs.
The best part is that we have all these options at our end in wordpress as well.
noopener is good for security reasons as it protects from cross site hacking.
Thanks for this detailed tutorial.
WPBeginner Support says
Glad we could share this
管理者
Oleg Bibik says
Great info, thanks. I now know the difference between noopener and nofollow.
WPBeginner Support says
Glad we could help clear that up
管理者
April says
The noopener is also present with the WordPress Classic editor.
WPBeginner Support says
True, we cover the block editor as that is the default editor for WordPress.
管理者
Maria says
Is that ok If i am using “noopener & Noreferrer” for interlinking?
WPBeginner Support says
You normally shouldn’t add that for internal links but you can if you would like.
管理者
Navneet Kumar says
Can we say rel=”noopener no referrer ” provide dofollow backlink to external website?
I mean if we receive this attribute then we received dofollow backlinks or nofollow backlinks?
Thanks in advance
WPBeginner Support says
These attributes would not affect if a link is dofollow or nofollow, that would be determined if the link is nofollow or not.
管理者
Nadya says
is it ok to use rel=”noopener noreferrer nofollow” in any position?
like
rel=”nofollow noopener noreferrer”
rel=”noreferrer nofollow noopener”
WPBeginner Support says
You shouldn’t need to worry about the order
管理者
Ryan says
Thank you for your article.
I checked my website on web.dev, and I was confused what is noopener and noreferrer.
After I put it to all of link with target=”_blank”, my best practice score went from <80 to 86.
Thank you.
WPBeginner Support says
Glad our guide could help, don’t forget that sites with scores like that are mainly suggestions
管理者
Jill says
Hello,
What about the custom templates used in WordPress? Should rel=”noopener” be used in the links in the custom posts templates? Especially, internal linking?
WPBeginner Support says
You would not need to worry about noopener in the links to the templates for your posts and custom post types.
管理者
Graham says
does this affect Analytics? Yes or no?
WPBeginner Support says
noreferrer will prevent Google Analytics from tracking the site that the link came from.
管理者
Lory says
Can we use noopener but remove noreferrer? Its driving me crazy messing up my analytics. Not only can I not see referral traffic, but I also cannot see which posts have done well over time since referral traffic now shows as direct traffic to my home page. If noopener is the important tag, why is noreferrer included with it? There has to be some way around this.
WPBeginner Support says
Unless I hear otherwise, we do not have a specific built-in method to set that up but there are plugins available if you are wanting to remove that from your links.
管理者
Zol says
Hye WPbeginner Support, O/
I don’t use plugin to cloak my affiliate links on my website and I just manually add rel=”nofollow” to affiliate links in html editor.
My question..is this a good practice for SEO ?
Should I cloak it?
Thanks in advanced for your reply..
WPBeginner Support says
Hi Zol,
It is good practice to cloak URLs. It allows you to better manage links, track your affiliate traffic, and makes your URLs look more understandable by both humans and machines.
管理者
Shyam Mahanta says
My wordpress have ssl certificate (auto ssl from the hosting company) but why the secure lock icon doesn’t appear in the Url? It opens in https but shows connection is not secure. Help is really appreciated.
WPBeginner Support says
Hi Shyam,
Please see our guide on fixing common SSL issues in WordPress.
管理者
Seleno says
Hello
I have affiliate website and since wordpress addded noopener my earnings droped down,
But i was not sure if it can cause this
So noopener will never effect the affiliate links ?
Usualy i’m removing it
And it will not effect the seo or internal links ?
Thanks
WPBeginner Support says
Hi Seleno,
It does not affect your affiliate links and have no impact on SEO.
管理者