CALL (239) 961-8285
ENDURTECH
  • Web Services
    • Web Design
      • Design and Development
      • Web Consulting and Tutoring
      • Hosting and Maintenance
      • Project Portfolio
    • Media
      • Photo and Audio, Video Editing
      • Social Media Management
      • All Web Related Services
    • Marketing
      • Digital Marketing and Branding
      • Search Engine Optimization
    • Client Portal
      • Remote Web Support
      • Web Services Payment
      • Scheduled Payments
  • Tech Support
    • Services
      • Computer Support and Repair
      • Data Backup and Recovery
      • Computer Security, Virus Removal
      • Computer Networking Support
      • Computer Consulting & Tutoring
      • All Technology Related Services
    • Blockchain
      • Blockchain Technology
      • Cryptocurrency Articles
    • Client Portal
      • Remote PC Support
      • Remote Monitoring & Management
      • Tech Services Payment
  • Articles
  • About
  • Talk to Me
  • Menu Menu

How to Prevent my WordPress Website from Logging Me Out

Web Site Support, WordPress

If you’ve spent time blogging on a WordPress website you’ve come across the dreaded blank WordPress page with the following text: -1

This error occurs, for example, when you’ve begun a post but fail to complete it for an extended length of time. This is a simple issue regarding cookie expiration.

In my case, I started a post one evening and decided to return to it in the morning. Upon my return I completed the post and pressed the Publish button only to be presented with a blank page showing -1.

Luckily I was able to hit the Back button in my browser which successfully restored my work to my tab. I copied the text, just to be sure, and tried to publish the post again. This time it succeeded without issue. What a relief.

To prevent your WordPress website session cookie from expiring on you we’ve discovered a code snippet which will keep users logged in indefinitely. NOTE: Implementing this code snippet is not recommended! It is only intended for a blogger with additional security measures in place and who only uses personal computers.

 

[su_note note_color=”#157BAE” text_color=”#ffffff” radius=”5″]Would you like prompt assistance? If you don’t have time or are not comfortable taking the risk of adding custom code to your website, let us get this done for you now![/su_note]

 

Preventing Logout

To utilize this snippet to prevent WordPress from logging you out of your session in the middle of your work add the following code to your functions.php file. Your functions.php file is located within your currently active theme or child-theme. We always highly recommend implementing a child-theme for your WordPress website. Do you need a child theme set up? We can help.

 

/*
** Keep Users Logged in Forever
*/
add_filter( 'auth_cookie_expiration', 'keep_users_login' );
function keep_users_login( $expirein )

{
    return "31557600"; // 1 year (in seconds)
}

 

Alternatively, you may set it so that only yourself (the administrator) is logged in ‘forever’ using the current_user_can function.

 

/*
** Admin-Only Function
*/
if( current_user_can( 'administrator' ) )
{
    // Function goes here
}

 

An example of the combined code follows:

 

/*
** Admin-Only Function
*/
if( current_user_can( 'administrator' ) )
{
    // Function: Keep Admin Logged in Forever
    add_filter( 'auth_cookie_expiration', 'keep_admin_login' );
function keep_admin_login( $expirein )

    {
        return "31557600"; // 1 year (in seconds)
}

}

 

We hope this article has helped prevent the “-1 blank page” issue from ever occurring again on your WordPress website. Should you need assistance implementing this solution on your existing WordPress website simply reach out to us at (239) 961-8285

 

We hope this article has helped you. If you found it helpful please take a moment to like us on Facebook, share this on your social media or buy us a cup of coffee.

 

Hire us to get it done for you!

Select, WordPress Support Basic, from the drop down list on the form below. We’ll help implement the above solution into your WordPress website today.

 

September 8, 2018
Share this entry
  • Share on Facebook
  • Share on X
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
https://endurtech.com/wp-content/uploads/2018/04/wordpress-content-management-system.jpg 512 512 Manny https://endurtech.com/wp-content/uploads/2018/04/endurtech-logo.png Manny2018-09-08 06:21:222024-09-04 13:16:18How to Prevent my WordPress Website from Logging Me Out
Search Search

CONNECT WITH US

This field is for validation purposes and should be left unchanged.
Engagement*

Want to say, "thanks"?
Leave me a review on Facebook and/or Google.

You can send me a tip using your Brave browser. Get Brave!

Only used to send you a receipt.
Include a Message
Popular
  • Windows Logo
    Second Monitor on Windows 10 Resets After SleepJuly 2, 2020 - 6:30 am
  • Windows Logo
    How to Disable the F1 Help Key in Windows 10April 15, 2021 - 2:40 pm
  • Cortana Logo
    How to Disable Microsoft’s CortanaApril 6, 2021 - 9:00 am
  • Firefox Logo
    How to Remove All Passwords from Lockwise in FirefoxMarch 26, 2020 - 11:00 am
Recent
  • How to Fix Brother BrLog Errors
    How to Fix Brother BrLog ErrorsAugust 24, 2026 - 10:55 am
  • How to block Facebook crawler
    List of Spider Crawlers to BlockAugust 10, 2026 - 9:20 am
  • Brave Browser Logo
    How to Fix the “Not Secure” Address Bar Err...July 20, 2026 - 12:48 pm
  • Linkpull Extension By Endurtech
    LinkPull Extension, Grab Any File From a URLJuly 7, 2026 - 7:35 pm

STAY IN TOUCH

ENDURTECH Web Design Company Naples, Florida

Endurtech GitHub ProfileEndurtech YouTube ChannelEndurtech LinkedIn ProfileEndurtech Facebook Page

5 Star Google Review for Endurtech - Naples Web Design Company

Learn More & Connect

Search Search
ENDURTECH Logo
Endurtech GitHub ProfileEndurtech YouTube ChannelEndurtech LinkedIn ProfileEndurtech Facebook Page

5 Star Google Review for Endurtech - Naples Web Design Company

Latest Articles

  • How to Fix Brother BrLog Errors
    How to Fix Brother BrLog ErrorsAugust 24, 2026 - 10:55 am
  • How to block Facebook crawler
    List of Spider Crawlers to BlockAugust 10, 2026 - 9:20 am
  • Brave Browser Logo
    How to Fix the “Not Secure” Address Bar ErrorJuly 20, 2026 - 12:48 pm
  • Linkpull Extension By Endurtech
    LinkPull Extension, Grab Any File From a URLJuly 7, 2026 - 7:35 pm

Recent Projects

  • Jewelry Website Gems of Note
    Gems of NoteNovember 15, 2019 - 10:16 pm
  • Gift Store Facebook Business Page Cover Video
    Gift Store Facebook Business Page Cover VideoApril 13, 2019 - 3:58 pm
  • Toledo Yoga BrandBot Footer Integration
    Toledo YogaApril 9, 2019 - 7:26 am
  • Lawyer Association Website with Member Portal
    National Employment Lawyers Association, Florida ChapterFebruary 26, 2019 - 8:00 am

Business Details

Mondays - Fridays
9:00 am - 5:00 pm
Eastern Standard Time
After hours by appointment

SUPPORT PHONE

(239) 961-8285

MAILING ADDRESS

59 Logan Ln.
Lynchburg, VA 24502

Copyright © 2026 ENDURTECH ® All Rights Reserved. Legal
Link to: UltimateMember Plugin file class-um-mobile-detect.php False Positive with WordFence Security Link to: UltimateMember Plugin file class-um-mobile-detect.php False Positive with WordFence Security UltimateMember Plugin file class-um-mobile-detect.php False Positive with WordFence...UltimateMember WordPress Plugin Hacked Link to: Microsoft Update Data Deletion Bug Warning Link to: Microsoft Update Data Deletion Bug Warning Windows 10 File Deletion Bug October 2018 UpdateMicrosoft Update Data Deletion Bug Warning
Scroll to top Scroll to top Scroll to top