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がログアウトし続ける問題の解決方法(初心者ガイド)

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

WordPressにすべてログアウトされないようにしようとしているのですか?

これはWordPressでよくあるエラーで、サイトでの作業がほぼ不可能になります。

この投稿では、WordPressセッションタイムアウト問題とも呼ばれるWordPress keeps logout問題を解決する方法を紹介します。

How to fix WordPress keeps logging out problem (quick & easy)

WordPressはなぜログアウト中なのか?

WordPressがあなたをログアウト中にし続ける主な理由はいくつかあります。しかし、最も一般的なのは、WordPressの設定と一致しないURLからサイトにアクセスしようとしている場合です。

WordPressサイトにログインすると、ログインセッションを認証するためにブラウザーにCookieが設定されます。Cookieは、設定メニューに保存されているWordPress URLに設定されます。

サイトのURLとWordPressのURLが一致しないと、WordPressはセッションを認証できず、ログアウト中になってしまいます。

これはWordPressのリダイレクトが多すぎるという問題にもつながります。

下の画像では、「WordPressアドレス」と「サイトアドレス」が異なるため、競合が発生します。

Site address conflict example

ということで、WordPressがログアウトし続ける問題を簡単に解決する方法をご紹介しましょう。

WordPressがログアウト中問題を修正する方法

このログイン問題の最も簡単な解決策は、「サイトアドレス」と「WordPressアドレス」フィールドに同じURLを入力することです。

これを行うには、WordPress管理画面の設定 ” 一般に移動します。

Go to general settings and check URLs

次に、URLが一致しているか再確認する。www’または’non-www’のURLを両方のフィールドで選択する必要があります。

技術的に言えば、「www」はサブドメインそのものである。つまり、「www」を含むURLと含まないURLは、実際には2つの異なるドメイン名である。

幸いなことに、URLを同じアドレスに変更して更新すれば問題は解決する。その後、「変更を保存」ボタンをクリックしてください。

WordPressにコードを追加してWordPressがログアウト中を続ける問題を解決する

WordPressダッシュボードにアクセスできない場合は、wp-config.phpファイルを手動で編集する必要があります。これは、サイトの重要なWordPress設定を含む特別なファイルです。

これを行うには、FileZillaのようなFTPクライアントまたはWordPressホスティングアカウントのコントロールパネルのファイルマネージャーアプリを使用することができます。

FTPの使い方の詳細については、FTPを使ってWordPressにファイルをアップロードする方法の初心者向けガイドをご覧ください。

次に、サイトのルート・ディレクトリにあるwp-config.phpファイルを探します。

Edit wpconfig.php file

ファイルをデスクトップにダウンロードし、メモ帳などお好みのテキストエディターで開いてください。

その後、「以上、編集を中止してください!ハッピー公開する:

define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');

URLに’www’を使いたい場合は、代わりに以下のコードを使うことができる:

define('WP_HOME','https://www.example.com');
define('WP_SITEURL','https://www.example.com');

‘example.com’のURLを自分のWordPressブログのURLに置き換えてください。

その後、ファイルを保存してルート・ディレクトリにアップロードしてください。これでWordPressは、サイトにログインした際のログアウトを停止するはずです。

ログアウトの問題が解決しない場合は、WordPressログインページのリフレッシュとリダイレクトの問題を解決する方法をご覧ください。

WordPressのログアウト中に関するよくある質問

WordPressのログアウト中について、読者からよく寄せられる質問にお答えします。

WordPressがログアウト中なのはなぜですか?

ほとんどの場合、WordPressの設定と一致しないURLからサイトにアクセスしようとしているため、WordPressはあなたをログアウト中にしています。

WordPressサイトにログインするたびに、ログインセッションを認証するためにブラウザーにCookieが保存されます。Cookieは、設定メニューのWordPress URLに保存されます。

サイトのURLとWordPressのURLが同じでないと、WordPressがセッションを認証できず、ログアウト中になってしまいます。

WordPressがログアウトするまでの時間は?

初期設定のWordPressログインセッションは48時間後に失効します。その後、WordPressはあなたをログアウトし、あなたは再びログインする必要があります。

WordPressのログイン画面で「ログイン情報を保存」にチェックを入れることで、これを回避することができる。そうすれば、14日間はログインを要求されなくなります。

この投稿がWordPressがログアウト中問題を解決する方法のお役に立てば幸いです。また、無料のビジネスメールアドレスの作成方法や、専門家が選ぶ最高のドメイン登録業者もご覧ください。

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

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

  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. Syed Zaki-ul-Hassan says

    After reading all these solutions and having applied but the problem was not resolved then I updated my WordPress Version problem solved.
    Thanks for Such great Knowledge.

  3. Paresh Koli says

    I was trying to access the website with www which was causing the issue of logout. Now Visiting the website without www works perfectly.

  4. Ibukun says

    Hi, I have been getting this error whenever I try to logout of my website.

    ATTENTION: You need to provide |:| USERNAME: admin |:| PASSWORD: admin |:| to see the actual WordPress Admin Login-Area page. This has to prevent WordPress Bruteforce Attack on your Website. Thank You! — SYS. ADMIN….

    Do you know any fix or solutions?

  5. Goombah says

    Thanks for this article. I was wondering if this could also be a theme issue, or is being logged out unrelated to that?

    • WPBeginner Support says

      While unlikely, if there is an error with your current theme it could cause an issue.

      管理者

  6. Megan says

    Both urls are the same, but don’t have www. Should I change that as this solution didn’t work for me. So frustrating when editing a post and then finding out nothing was saved!

    • WPBeginner Support says

      With or without www shouldn’t matter, if our recommendation is not working we would recommend checking with your hosting provider to see if they see any issues on their end.

      管理者

      • Megan says

        Thanks, I have contacted her, but haven’t had any response yet. She may not be operating anymore.
        It seems to be working again now, I updated some of the plugins.

    • WPBeginner Support says

      Thanks for sharing what worked for you, not every site will have the exact same plugin cause this issue :)

      管理者

  7. Håkon Berntsen says

    Worked like a charm. Interesting article that pointed out an error that I would never thought about myself. The settings was correct, but re-save it forced it to work again.

    • WPBeginner Support says

      You may want to check with your host to see if there are any errors on the hosting end that could be part of the issue

      管理者

  8. Laura Ingalls Gunn says

    Hello
    My settings match and I’m still having the issue.
    I’ve also tried

    -different browsers
    -clearing cookies
    -clearing cache
    -deactivating each plugin one by one

    Any other solutions would be helpful. Thank you.

    • WPBeginner Support says

      Have you deactivated all of the plugins rather than one at a time and swapped themes to ensure it isn’t a conflict through one of those?

      管理者

  9. Tom Little says

    I try and follow these instructions but I do not seem to get the same Screen when I visit General Settings as the one shown here (I do not see the dialogue boxes that show Site URLs).

    I am not sure if they are somewhere else but it seem to me these instructions are either outdated or I have to go another route. Any suggestions would be greatly appreciated.

  10. Ralf says

    How about multisite? There’s no such place to enter the URL. And then, after logging in many times, the login will eventually “stick”, without changing anything …

    • WPBeginner Support says

      You would want to try the wp-config method and that should still work for multisite

      管理者

  11. Tally Briggs says

    I cannot even get to that settings page. I’m using safari and have only started having the problem with a site I comment on regularly, and have had no problems with for almost a decade.

  12. Amol karde says

    hi…thanks for sharing this informative article
    but i am finding issue in my website when i entered into dashboard i saw network admin and my website name as given when i go into network admin it will logout automatically. Please give me some solution or what i can do for logging into admin network.

    Thanking You…!!!

  13. Seaira (really) says

    Hi: I was using hostgator hosting for about 8 years with many websites. I had no problems installing wp and uploading paid templates in .zip from my computer.
    I switched to godaddy hosting and commenced to creating wp-real-estate 7 pro from theme forest. But after trying multiple times to upload the template, I had to give up. First tried uploading direct into the wp installation. Then tried direct into my file manager in CP. it would take about 20 minutes each time and then say : “are you sure you want to do this…and a box saying try again.
    site and url are both . I always used just in the past. Being they are the same, I never thought to change them to should I? Also I was signing in at:. I paid someone to help me and they tried signing in at:
    and said failed. So I had to change the passcode to get in that url. He has not done anything since and wonder if I should cancel the order and try again after I know why the .zip file won’t load. Maybe you can enlighten me.

  14. Marco says

    I had the same problem, caused by the Chrome extension WordPress Site Manager. When I turned it off the problem disappear.

  15. Ariful Haque says

    My site has https in front-end and in the admin panel its only http. Both has www in it. But the site keep logging out. Can this http protocol be a cause?

  16. Dimitrios Charalampidis says

    I had to change http:// to https:// since I am using an SSL certificate and that solved the issue. The article showed me the correct path… Thanks.

  17. Mukhtar Jafari says

    It did not work for me.
    The URLs are the same and again it gives me the same error.
    Any suggestion plz?

  18. Travis S says

    My settings match and I’m still having the issue. It is horribly frustrating, it happens a couple of times a minute.
    I’ve tried
    -changing both settings to www
    -different browsers
    -clearing cookies
    -clearing cache
    -changing themes
    -now working through plugins one by one. The issue goes away if I disable all plugins.

  19. Travis S says

    My settings match and I’m still having the issue. It is horribly frustrating, it happens a couple of times a minute.

  20. Kevin Green says

    Similar to Julie G above I have my wordpress installation in its own directory (to avoid conflict with an existing site in root) as described here

    therefore

    my wordpress address is
    my site address is

    The logging out problem is particularly annoying with the Appearance/Themes/Live Preview option which essentially will not work due to continued timeout/logout

    Has anyone solved this for this kind of situation?

    • Kevin Green says

      I just noticed the site name which I had in ” has gotten lost in translation, it should read:-

      my wordpress address is
      my site address is

      • Kevin Green says

        I don’t know what happened with my attempts to quote example urls and the information on how to have wordpress run from a sub-directory but essentially my wordpress installation is in a sub-directory called wordpress & so my urls have to be:

        WordPress Address URL http://wordpress.example.com

        Site Address URL http://example.com

        Is there a fix that solves this situation short of re-installing wordpress in root

  21. Sheila says

    Hi,

    I have the same URL in my Site Address and WordPress Address fields in the WordPress settings. Have never changed these settings.

    So what would be causing my issue?

    Thanks

  22. Gerardo says

    Just one word: THANKS!!!!

    i have setting URL without www and all working fine.

    i Have a subdomain www, do u think it better setting both url with WWW or without?

    Thank u very much

  23. Jamie says

    I keep having this problem but it’s with HTTPs…. Anyone experienced that?

    I have my URL set in the config file. Maybe I should unset it…

  24. Vienna says

    I keep being asked to log in on my blog. I checked Settings/General in my admin and do not see W/P address or Site Address.
    What am I missing ?
    I use my iPad for my blog and checked that cookies are enabled in the iPad Safari.
    Is there anything else I should do?
    This is a recent problem and I don’t know why it has happened.

  25. Tommy says

    I swear every time I have a problem with WP, you guys solve it. WP should just redirect here :)

    Thanks as always and keep up the great work.

  26. ray says

    great topic.. fixed my problem. I cloned the my site to a other server. On the VPS the admin is available on example.com:8080/wp-admin. I changed it and now the admin works like a charm!

    Thnks again

  27. Louise Krohn says

    Thanks for this web site. I am a brand new user of WordPress, so I appreciate having access to your tutorials. I have been working on this web site for a couple of weeks, and until a couple of days ago, I had not seen the “Your session has expired” comment. Both the site address and the WordPress address are the same (and have been since the beginning). So, what else could be causing this problem?

  28. John Thom says

    This solution applies to WordPress without MultiSite? When activating MultiSite WordPress gives the following message:

    Server Address:
    We recommend you change your siteurl to mydomain.org.uk before enabling the network feature. It will still be possible to visit your site using the www prefix with an address like http://www.mydomain.org.uk but any links will not have the www prefix.

    The effect of using www. in WPMS is that accessing http://mydomain.com/sample-page/ redirects users to the hompage, rather than WordPress self-correcting and redirecting to http://www. … … .

返信を残す

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