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

Como corrigir o problema do WordPress que continua se desconectando (Guia para iniciantes)

Poucas coisas são mais frustrantes do que quando o WordPress continua fazendo logout da sua área de administração.

Esse é um erro comum do WordPress que torna quase impossível trabalhar em seu site. Esse também é um dos nossos problemas preferidos nos últimos mais de 16 anos de blog, por isso procuramos todas as maneiras de impedir que o WordPress faça o logout do seu site.

Neste artigo, mostraremos como corrigir o problema do WordPress que continua se desconectando, também conhecido como problema de tempo limite da sessão do WordPress.

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

Dica de especialista: Está cansado de tentar corrigir erros do WordPress por conta própria? Talvez seja hora de recorrer aos profissionais. Nossos Serviços de Suporte Premium para WordPress podem corrigir rapidamente qualquer erro em seu site, inclusive o problema de tempo limite da sessão do WordPress. Além disso, nosso serviço está disponível 24 horas por dia, 7 dias por semana, sempre que você precisar.

Por que o WordPress continua fazendo logout?

Existem alguns motivos principais pelos quais o WordPress continua fazendo o logout. Mas o mais comum é que você esteja tentando acessar seu site a partir de um URL que não corresponde ao que está nas configurações do WordPress.

Quando você fizer login no site do WordPress, ele definirá um cookie no navegador para autenticar a sessão de login. O cookie é definido para a URL do WordPress armazenada em seu menu de configurações.

Se a URL do site e a URL do WordPress não corresponderem, o WordPress não conseguirá autenticar a sessão e você será desconectado.

Isso também pode resultar no problema de excesso de redirecionamentos no WordPress.

Na imagem abaixo, o “Endereço do WordPress” e o “Endereço do site” são diferentes, portanto, haverá um conflito.

Site address conflict example

Dito isso, vamos mostrar como corrigir facilmente o problema de o WordPress continuar fazendo logout.

Como corrigir o problema do WordPress que mantém o logout

A correção mais simples para esse problema de login é garantir que você tenha o mesmo URL nos campos “Endereço do site” e “Endereço do WordPress”.

Para fazer isso, navegue até Configurações ” Geral no painel de administração do WordPress.

Go to general settings and check URLs

Em seguida, verifique novamente se os URLs correspondem. Você precisa escolher um URL “www” ou “não www” em ambos os campos.

Tecnicamente falando, “www” é um subdomínio em si. Isso significa que os URLs com “www” e sem ele são, na verdade, dois nomes de domínio diferentes.

Felizmente, alterar e atualizar os URLs para o mesmo endereço corrigirá o problema. Em seguida, certifique-se de clicar no botão “Salvar alterações”.

Como corrigir o problema do WordPress que mantém o logout adicionando código ao WordPress

Se não for possível acessar o painel do WordPress, será necessário editar manualmente o arquivo wp-config.php. Esse é um arquivo especial que contém configurações importantes do WordPress para seu site.

Para fazer isso, você pode usar um cliente FTP como o FileZilla ou o aplicativo gerenciador de arquivos no painel de controle da sua conta de hospedagem WordPress.

Para obter mais detalhes sobre o uso do FTP, consulte nosso guia para iniciantes sobre como usar o FTP para fazer upload de arquivos no WordPress.

Em seguida, localize o arquivo wp-config.php no diretório raiz de seu site.

Edit wpconfig.php file

Você pode baixar o arquivo na área de trabalho e abri-lo no editor de texto de sua preferência, como o Bloco de Notas.

Depois disso, adicione o seguinte código acima da linha que diz: “That’s all, stop editing! Feliz publicação”:

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

Se você quiser usar “www” no URL, poderá usar o código a seguir:

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

Certifique-se de substituir o URL “example.com” pelo URL de seu próprio blog do WordPress.

Em seguida, você precisa salvar o arquivo e carregá-lo de volta ao diretório raiz. Agora, o WordPress deve parar de fazer o logout quando você fizer login no site.

Se você ainda estiver enfrentando o mesmo problema de logout, consulte nosso guia sobre como corrigir o problema de atualização e redirecionamento da página de login do WordPress.

Perguntas frequentes sobre o logout do WordPress

Aqui estão as respostas para as perguntas mais comuns que nossos leitores nos fazem sobre o logout do WordPress.

Por que o WordPress continua me desconectando?

Na maioria dos casos, o WordPress continua fazendo o logout porque você está tentando acessar o site a partir de um URL que não corresponde ao que está nas configurações do WordPress.

Toda vez que você faz login no site do WordPress, ele salva um cookie no navegador para autenticar a sessão de login. O cookie é salvo para o URL do WordPress em seu menu de configurações.

Se a URL do site e a URL do WordPress não forem as mesmas, o WordPress não poderá autenticar a sessão e você será desconectado.

Quanto tempo leva para o WordPress fazer seu logout?

Uma sessão de login padrão do WordPress expirará após 48 horas. Então, o WordPress fará o logout e você terá que fazer login novamente.

Você pode contornar isso marcando a caixa ao lado de “Remember Me” na tela de login do WordPress. Assim, você não será solicitado a fazer login novamente por 14 dias.

Esperamos que este artigo tenha ajudado você a aprender como corrigir o problema de logout contínuo do WordPress. Talvez você também queira ver nosso guia sobre como criar um endereço de e-mail comercial gratuito e nossas escolhas de especialistas para os melhores registradores de nomes de domínio.

Se você gostou deste artigo, inscreva-se em nosso canal do YouTube para receber tutoriais em vídeo sobre o WordPress. Você também pode nos encontrar no Twitter e no Facebook.

Divulgação: Nosso conteúdo é apoiado pelo leitor. Isso significa que, se você clicar em alguns de nossos links, poderemos receber uma comissão. Veja como o WPBeginner é financiado, por que isso é importante e como você pode nos apoiar. Aqui está nosso processo editorial.

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.

O kit de ferramentas definitivo WordPress

Obtenha acesso GRATUITO ao nosso kit de ferramentas - uma coleção de produtos e recursos relacionados ao WordPress que todo profissional deve ter!

Reader Interactions

64 ComentáriosDeixe uma resposta

  1. Syed Zaki-ul-Hassan

    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.

    • WPBeginner Support

      Thanks for sharing what worked for you should someone else run into the same issue :)

      Administrador

  2. Paresh Koli

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

    • WPBeginner Support

      Glad our guide was able to help :)

      Administrador

  3. Ibukun

    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?

  4. Goombah

    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

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

      Administrador

  5. Megan

    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

      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.

      Administrador

      • Megan

        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.

  6. Andres

    My solution was deactivating the Better Search Replace plugin.

    • WPBeginner Support

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

      Administrador

  7. Esther

    This broke my website, and now I can’t log back in.

  8. Håkon Berntsen

    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

      Glad our recommendation was able to help :)

      Administrador

  9. Lu

    I keep getting disconnected and my URLs match. Any other solutions?
    Thanks

    • WPBeginner Support

      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

      Administrador

  10. Laura Ingalls Gunn

    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

      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?

      Administrador

  11. Tom Little

    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.

  12. Ralf

    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

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

      Administrador

  13. Bassey Bassey

    It worked for me….Thanks for the post.

    • WPBeginner Support

      Glad it was helpful :)

      Administrador

  14. Lisa

    This did not fix my issue. Are there any other solutions?

  15. Tally Briggs

    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.

    • Jim

      I would try another browser to see if it’s a browser issue.

  16. Amol karde

    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…!!!

  17. Seaira (really)

    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.

  18. Marco

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

  19. Ariful Haque

    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?

  20. Dimitrios Charalampidis

    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.

  21. Elena

    It worked for me and I learned something new :). Thanks a lot.

  22. Mukhtar Jafari

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

    • PenX

      I have same problem, did u find any solution???

  23. Travis S

    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.

  24. Travis S

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

  25. Jonny boy

    worked a treat thank you very much!

  26. Kevin Green

    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

      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

    • WPBeginner Support

      Visit the Settings page and make sure that your WordPress Address and Site Address fields are correct.

      Administrador

      • Kevin Green

        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

  27. Paul Thom

    Thank you, worked a treat..

  28. Kaushal pal

    Wow….. that’s great……… thank’s…..

  29. Sheila

    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

  30. Prabhu

    Hey thanks a lot. Your solution fixed my website logout issue.

  31. Gerardo

    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

  32. Jamie

    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…

  33. Kris

    Spent 3 days trying to fix this, then found your article & it worked, thanks!!!

  34. Vienna

    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.

  35. Tommy

    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.

  36. ray

    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

  37. Louise Krohn

    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?

  38. Trixee

    Is there a variable in a config file I can update? The above solution doesn’t apply to me.

  39. John Thom

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

Deixe uma resposta

Obrigado por deixar um comentário. Lembre-se de que todos os comentários são moderados de acordo com nossos política de comentários, e seu endereço de e-mail NÃO será publicado. NÃO use palavras-chave no campo do nome. Vamos ter uma conversa pessoal e significativa.