Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPBカップ
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPressのrel=”noopener “とは?解説

編集メモ: WPBeginner のパートナーリンクから手数料を得ています。手数料は編集者の意見や評価に影響を与えません。編集プロセスについて詳しく知る。

WordPressにおけるrel="noopener "の意味を不思議に思ったことはありませんか?

新しいタブで開くリンクを追加すると、WordPressは自動的にそのリンクにrel="noopener "属性を追加します。

この投稿では、WordPressにおけるrel="noopener "の意味と、サイトへの影響について説明します。

What Is rel="noopener" in WordPress? (Explained)

WordPressのrel=”noopener “とは?

WordPressサイトにリンクを追加する場合、HTML属性を使用してリンクをクリックしたときの動作をコントロールすることができます。

例えば、リンクを作成する際、新しいタブで開くかどうかのトグルスイッチがある。

Opening a Link in a New Tab

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;
}
Adding a Code Snippet Using WPCode

本当に〜してもよいですか?’Active’トグルをオンにして、’Save Snippet’ボタンをクリックします。

これでWordPressが新規リンクにrel="noopener "を追加しないようになります。また、古いリンクを手動で編集して属性を削除する必要があります。

WordPressでリンクに追加するrel属性をもっとコントロールしたいですか?AIOSEOプラグインを使えば、WordPressエディター上でtitle、nofollow、その他のリンク属性を追加することができます。

AIOSEO Adds NoFollow and Title Attributes to the Insert Link Popup

WordPressでリンクを使うためのエキスパートガイド

rel="noopener "の意味がお分かりいただけたと思いますので、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.

情報開示 私たちのコンテンツは読者支援型です。これは、あなたが私たちのリンクの一部をクリックした場合、私たちはコミッションを得ることができることを意味します。 WPBeginnerの資金源 をご覧ください。3$編集プロセスをご覧ください。

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

究極のWordPressツールキット

ツールキットへの無料アクセス - すべてのプロフェッショナルが持つべきWordPress関連製品とリソースのコレクション!

Reader Interactions

27件のコメント返信を残す

  1. 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!

  2. 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

      You normally shouldn’t add that for internal links but you can if you would like.

      管理者

  3. 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.

      管理者

  4. Nadya says

    is it ok to use rel=”noopener noreferrer nofollow” in any position?

    like

    rel=”nofollow noopener noreferrer”
    rel=”noreferrer nofollow noopener”

  5. 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 :)

      管理者

  6. 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.

      管理者

    • WPBeginner Support says

      noreferrer will prevent Google Analytics from tracking the site that the link came from.

      管理者

  7. 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.

      管理者

  8. 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.

      管理者

  9. 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.

  10. 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

返信を残す

コメントありがとうございます。すべてのコメントは私たちのコメントポリシーに従ってモデレートされ、あなたのメールアドレスが公開されることはありませんのでご留意ください。名前欄にキーワードを使用しないでください。個人的で有意義な会話をしましょう。