{"id":36848,"date":"2021-09-22T12:03:31","date_gmt":"2021-09-22T12:03:31","guid":{"rendered":"\/tutorials\/?p=36848"},"modified":"2026-03-09T19:19:05","modified_gmt":"2026-03-09T19:19:05","slug":"how-to-fix-the-401-unauthorized-error","status":"publish","type":"post","link":"\/ng\/tutorials\/how-to-fix-the-401-unauthorized-error","title":{"rendered":"How to fix the \u201c401 Unauthorized\u201d error"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>The &ldquo;401 Unauthorized&rdquo; error is an HTTP status code that occurs when a web server denies access to a specific web page or resource you are trying to reach. This happens because the request lacks valid authentication credentials, such as a username and password, or the provided credentials are incorrect. <\/p><p>This error doesn&rsquo;t affect your ability to access other parts of the website that don&rsquo;t require authentication. Essentially, the server recognizes your request but will not fulfill it until you can prove you have permission to access the content.<\/p><p>There are seven quick methods to fix the &ldquo;401 Unauthorized&rdquo; error:<\/p><ol class=\"wp-block-list\">\n<li><strong><a href=\"#check-authentication-credentials\">Check authentication credentials<\/a>.<\/strong> Try re-entering your username, password, or API key carefully.<\/li>\n\n\n\n<li><strong><a href=\"#confirm-the-url-is-correct\">Confirm the URL is correct<\/a>.<\/strong> Double-check if the link is misspelled or if the resource path is incorrect.<\/li>\n\n\n\n<li><strong><a href=\"#clear-your-browser-s-cookies-and-cache\">Clear your browser&rsquo;s cookies and cache<\/a>.<\/strong> Remove stored data in your browser settings, then try again.<\/li>\n\n\n\n<li><strong><a href=\"#flush-dns-cache\">Flush DNS cache<\/a>.<\/strong> Run a DNS flush command to reset old entries.<\/li>\n\n\n\n<li><strong><a href=\"#disable-password-protection\">Disable password protection<\/a>.<\/strong> Review and adjust your server&rsquo;s .htaccess or hosting panel settings.<\/li>\n\n\n\n<li><strong><a href=\"#disable-plugins-modules-and-themes\">Disable plugins, modules, and themes<\/a>. <\/strong>Temporarily deactivate them one by one to spot any conflicts.<\/li>\n\n\n\n<li><strong><a href=\"#check-the-www-authenticate-header\">Check the WWW-Authenticate header<\/a>.<\/strong> Inspect the response header to see the required authentication method.<\/li>\n<\/ol><p>Keep reading for a walkthrough of all the methods to solve the 401 error, learn the causes, and recognize error variations.<\/p><h2 class=\"wp-block-heading\" id=\"check-authentication-credentials\">1. Check authentication credentials<\/h2><p>The 401 page may appear when you&rsquo;re trying to gain access to restricted resources, such as a password-protected page, with invalid authentication credentials. As a result, you&rsquo;re unable to open the page.<\/p><p>First thing to do is double-check whether you&rsquo;re logged in with a valid user ID and password. If you&rsquo;re sure that you have entered valid authentication credentials, try changing the password.<\/p><p>If you&rsquo;re having trouble accessing a password-protected WordPress site, make sure you know <a href=\"\/ng\/tutorials\/change-wordpress-password\/\">how to change your WordPress admin password<\/a>.<\/p><p>In case you&rsquo;re accessing a resource via an <a href=\"\/ng\/tutorials\/what-is-a-public-api\">application programming interface (API)<\/a>, ensure that your API keys or tokens are correct and have the necessary permissions. Incorrect or missing API credentials can also trigger a 401 error.<\/p><h2 class=\"wp-block-heading\" id=\"confirm-the-url-is-correct\">2. Confirm the URL is correct<\/h2><p>A wrong URL is a common cause of 401 HTTP status codes. So, make sure that the web address is typed correctly in your browser&rsquo;s address bar, especially if it includes special characters or numbers.<\/p><p>Typos in hyperlinks from other sites can also lead to this error. If unsure, navigate from the website&rsquo;s homepage or use a search engine to find the correct web pages.<\/p><h2 class=\"wp-block-heading\" id=\"clear-your-browser-s-cookies-and-cache\">3. Clear your browser&rsquo;s cookies and cache<\/h2><p>A corrupted or outdated browser cache and cookies may lead to a server authentication failure. It&rsquo;s also possible that the current cache and cookies are outdated and in need of manual refreshing.<\/p><p>To delete the cached data and browser cookies, go to your browser&rsquo;s settings and find the option to clear them. If you use Google Chrome, follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Click on the three dots to open the menu in the top-right corner.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69e1b3f763105\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1599\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/three-dot-button-on-google-chrome-scaled.png\/public\" alt=\"Three dotted menu icon highlighted in Google Chrome\" class=\"wp-image-133251\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/three-dot-button-on-google-chrome-scaled.png\/w=2560,fit=scale-down 2560w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/three-dot-button-on-google-chrome-scaled.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/three-dot-button-on-google-chrome-scaled.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/three-dot-button-on-google-chrome-scaled.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/three-dot-button-on-google-chrome-scaled.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/three-dot-button-on-google-chrome-scaled.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/three-dot-button-on-google-chrome-scaled.png\/w=2048,fit=scale-down 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol start=\"2\" class=\"wp-block-list\">\n<li>Select<strong> Delete Browsing Data<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69e1b3f765962\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1599\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-menu-1-scaled.png\/public\" alt=\"Delete Browsing Data highlighted in the expanded browser settings\" class=\"wp-image-133253\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-menu-1-scaled.png\/w=2560,fit=scale-down 2560w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-menu-1-scaled.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-menu-1-scaled.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-menu-1-scaled.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-menu-1-scaled.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-menu-1-scaled.png\/w=1536,fit=scale-down 1536w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-menu-1-scaled.png\/w=2048,fit=scale-down 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>In the <strong>Time range <\/strong>drop-down menu, select <strong>All time<\/strong>.<\/li>\n\n\n\n<li>Check <strong>Cookies and other site data <\/strong>and <strong>Cached images and files<\/strong>.<\/li>\n\n\n\n<li>Click the <strong>Delete data<\/strong> button to finish.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69e1b3f768005\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1011\" height=\"929\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-popup-2.png\/public\" alt=\"Google Chrome's Delete browsing data pop-up\" class=\"wp-image-133259\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-popup-2.png\/w=1011,fit=scale-down 1011w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-popup-2.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-popup-2.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/09\/chrome-delete-browsing-data-popup-2.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1011px) 100vw, 1011px\" \/><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>For a detailed guide on how to do this on other browsers, check out our tutorial on <a href=\"\/ng\/tutorials\/clear-browser-cache\">how to clear browser cache<\/a>.<\/p><h2 class=\"wp-block-heading\" id=\"flush-dns-cache\">4. Flush DNS cache<\/h2><p>The data in the <a href=\"\/ng\/tutorials\/what-is-dns\">domain name system (DNS)<\/a> cache lets your device match URLs to their IP addresses faster for shorter loading times. However, unlike the browser&rsquo;s cache and cookies, the DNS cache operates on the system level.<\/p><p>Although rare, a DNS error may result in the 401 HTTP status code. The cache may be outdated and contain incorrect URL and IP address details.<\/p><p>Flushing your DNS will clear the existing DNS records of your device. Thsi will force it to make a completely new request and re-authenticate the URLs.<\/p><p>Follow our guide on <a href=\"\/ng\/tutorials\/how-to-flush-dns\">how to flush the DNS cache<\/a> if you&rsquo;re not sure how to do it.<\/p><h2 class=\"wp-block-heading\" id=\"disable-password-protection\">5. Disable password protection<\/h2><p>If you&rsquo;re a website owner trying to solve the 401 error, it&rsquo;s worth temporarily disabling password protection for the problematic section of your website.<\/p><p>If you have enabled password protection using <strong>.htaccess <\/strong>and <strong>.htpasswd <\/strong>files, follow these steps to disable it:<\/p><ol class=\"wp-block-list\">\n<li>Go to your web hosting account&rsquo;s <strong>File Manager<\/strong>.<\/li>\n\n\n\n<li>Open the password-protected website directory.<\/li>\n<\/ol><p>Find the <strong>.htaccess <\/strong>file that you created when you first enabled password protection. Its content should look similar to this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">AuthType Basic\nAuthName \"Your authorization required message.\"\nAuthUserFile \/path\/to\/.htpasswd\nrequire valid-user<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>Back up the content of the <strong>.htaccess <\/strong>file in case you want to re-enable password protection in the future.<\/li>\n\n\n\n<li>Delete the <strong>.htaccess <\/strong>file from the directory.<\/li>\n\n\n\n<li>Find the secret location of the <strong>.htpasswd <\/strong>file, back it up, and delete it as well.<\/li>\n<\/ol><p>For more information, follow this guide to learn <a href=\"\/ng\/tutorials\/create-default-wordpress-htaccess-file\">how to locate and create a WordPress .htaccess file<\/a>.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Pro tip<\/h4>\n                    <p>If you host a website on Hostinger, you can <a href=\"https:\/\/support.hostinger.com\/en\/articles\/1583470-how-to-password-protect-a-website-in-hostinger\">manage password-protected website directories on hPanel<\/a>.<\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"disable-plugins-modules-and-themes\">6. Disable plugins, modules, and themes<\/h2><p>If you get the &ldquo;401 Unauthorized&rdquo; error as a website&rsquo;s administrator, you can try to identify its cause by disabling the plugins, modules, and themes you have installed on your website.<\/p><p>For example, if you have a WordPress site and can access its admin dashboard, consider changing your theme to the default and disabling all your plugins.<\/p><p>To <a href=\"\/ng\/tutorials\/change-a-theme-in-wordpress\">change back to the default theme<\/a>, go to <strong>Appearance &rarr; Themes<\/strong> and <strong>Activate <\/strong>the default theme.<\/p><p>To disable all <a href=\"\/ng\/tutorials\/what-is-wordpress-plugin\">WordPress plugins<\/a> at the same time, go to <strong>Plugins &rarr; Installed Plugins<\/strong>. Bulk-select all the plugins, choose <strong>Deactivate <\/strong>from the drop-down menu, and click <strong>Apply<\/strong>.<\/p><p>The process to change your design template and disable the modules should be similar to any other CMS dashboard.<\/p><p>If you don&rsquo;t have access to your WordPress admin dashboard, you can <a href=\"https:\/\/support.hostinger.com\/en\/articles\/4411258-how-to-disable-wordpress-plugins-without-access-to-the-admin-page\">disable your WordPress plugins<\/a> by opening the File Manager on your hosting account and renaming the <strong>Plugins<\/strong> folder. Hostinger users can manage their plugins straight from hPanel.<\/p><p>Similarly, you can <a href=\"https:\/\/support.hostinger.com\/en\/articles\/4469298-how-to-change-wordpress-theme-via-phpmyadmin\">change your WordPress theme<\/a> without opening the admin dashboard by making changes to files through File Manager and phpMyAdmin.<\/p><h2 class=\"wp-block-heading\" id=\"check-the-www-authenticate-header\">7. Check the WWW-Authenticate header<\/h2><p>A server generating a &ldquo;401 Unauthorized&rdquo; response has to send a WWW-Authenticate header field containing at least one challenge applicable to the target resource, <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc7235#section-4.1\">according to the IETF<\/a>.<\/p><p>This response header determines the authentication method the web browser should follow to access a specific page. Knowing what response the header sends and which authentication method is used will help determine the problem.<\/p><p>To check a WWW-Authenticate header for the cause of the 401 error, follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Access the page that generates the 401 error code. If you&rsquo;re using Chrome, right-click it and select <strong>Inspect <\/strong>or press <strong>Ctrl+Shift+J<\/strong> to open the developer console.<\/li>\n\n\n\n<li>Open the <strong>Network<\/strong> tab, then reload the page. Click on the entry with the 401 error status.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/12\/inspect-401-error.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/inspect-401-error.png\/public\" alt=\"How to check a WWW-Authenticate header for the cause of the 401 error.\" class=\"wp-image-41429\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/inspect-401-error.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/inspect-401-error.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/inspect-401-error.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/inspect-401-error.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/inspect-401-error.png\/w=1536,fit=scale-down 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>Open the <strong>Headers <\/strong>tab. Find the <strong>WWW-Authenticate<\/strong> entry under the <strong>Response Headers<\/strong> section. It will show the authentication method the server enforces to provide access to the content. <\/li>\n<\/ol><figure class=\"wp-block-image size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/03\/image2-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/03\/image2-2.png\/public\" alt=\"WWW-authenticate entry highlighted\" class=\"wp-image-106583\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/03\/image2-2.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/03\/image2-2.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/03\/image2-2.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/03\/image2-2.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><ol start=\"4\" class=\"wp-block-list\">\n<li>Refer to the <a href=\"https:\/\/www.iana.org\/assignments\/http-authschemes\/http-authschemes.xhtml\">HTTP Authentication Scheme Registry<\/a> to find out the page&rsquo;s authentication method. In this case, the page uses the basic authentication method, which means that it only requires standard login credentials.<\/li>\n<\/ol><h2 class=\"wp-block-heading\" id=\"h-what-causes-the-401-unauthorized-error\"><strong>What causes the &ldquo;401 Unauthorized&rdquo;<\/strong> <strong>error<\/strong>?<\/h2><p>A 401 error occurs when a page requires valid authentication credentials but they&rsquo;re missing, invalid, or expired. Some common triggers include:<\/p><ul class=\"wp-block-list\">\n<li><strong>Incorrect authentication credentials.<\/strong> This happens when the login details you provide, such as your username, password, or API key, don&rsquo;t match the records stored on the server. Even small mistakes, like a typo or using outdated credentials, can trigger the error.<\/li>\n\n\n\n<li><strong>Incorrect URL.<\/strong> A mistyped or outdated URL may point to a resource that requires authentication but doesn&rsquo;t recognize your request, resulting in a 401 response.<\/li>\n\n\n\n<li><strong>Session timeout.<\/strong> Many websites use time-limited sessions for security. If you stay idle for too long, the server invalidates your session, and any further requests are denied until you log in again.<\/li>\n\n\n\n<li><strong>Misconfigured permissions.<\/strong> On the server side, file or directory permissions might be set incorrectly.<\/li>\n\n\n\n<li><strong>Unsupported authentication method.<\/strong> Some servers require specific authentication protocols, like Basic Auth, OAuth, Bearer tokens. If your request uses a different or outdated method, the server won&rsquo;t accept it, leading to a 401 error.<\/li>\n<\/ul><h3 class=\"wp-block-heading\" id=\"h-what-are-the-401-error-variations\"><strong>What are the 401 error variations?<\/strong><\/h3><p>When encountering a 401 response, instead of reaching the intended web page, your browser will display an error message. These messages serve as indicators of the specific type of 401 error you&rsquo;re experiencing.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/12\/401-error.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1919\" height=\"433\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/401-error.png\/public\" alt=\"Example of 401 error.\" class=\"wp-image-41423\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/401-error.png\/w=1919,fit=scale-down 1919w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/401-error.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/401-error.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/401-error.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/401-error.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2021\/12\/401-error.png\/w=1536,fit=scale-down 1536w\" sizes=\"auto, (max-width: 1919px) 100vw, 1919px\" \/><\/a><\/figure><\/div><p>Commonly seen messages include:<\/p><ul class=\"wp-block-list\">\n<li>HTTP Error 401<\/li>\n\n\n\n<li>401 Authorization Required<\/li>\n\n\n\n<li>401 Unauthorized Error<\/li>\n\n\n\n<li>Access Denied<\/li>\n\n\n\n<li>Unauthorized<\/li>\n<\/ul><p>Each variation of the 401 error provides insights into why the authentication process failed, helping you diagnose and resolve access issues.<\/p><p>Below is a detailed list of various 401 error codes, along with their specific meanings:<\/p><ul class=\"wp-block-list\">\n<li><strong>401.1<\/strong>. The login attempt has failed, usually due to incorrect authentication credentials being provided.<\/li>\n\n\n\n<li><strong>401.2<\/strong>. The login attempt has been obstructed by server configuration issues, preventing successful authentication.<\/li>\n\n\n\n<li><strong>401.3<\/strong>. Access is denied due to the access control list (ACL) settings, which restrict resource access based on user permissions.<\/li>\n\n\n\n<li><strong>401.501<\/strong>. Too many requests have been generated by the client, or the client has reached the maximum request limit.<\/li>\n\n\n\n<li><strong>401.502<\/strong>. This error occurs when a particular client (same IP) sends multiple requests to a single server, reaching the dynamic IP Restriction Concurrent request rate limit.<\/li>\n\n\n\n<li><strong>401.503<\/strong>. The client&rsquo;s <a href=\"\/ng\/tutorials\/what-is-ip-address\">IP address<\/a> is included in the server&rsquo;s deny list.<\/li>\n\n\n\n<li><strong>401.504<\/strong>. The client&rsquo;s hostname is included in the server&rsquo;s deny list.<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-401-unauthorized-vs-403-forbidden-error\"><strong>401 Unauthorized vs 403 Forbidden error<\/strong><\/h2><p>The 401 error is just one example of the many errors in the 400 range you might encounter. Another common one that often causes confusion is the 403 Forbidden error.<\/p><p>While a 401 error means unauthorized access due to invalid or missing credentials, a <a href=\"\/ng\/tutorials\/what-is-403-forbidden-error-and-how-to-fix-it\">403 error<\/a> indicates you&rsquo;re forbidden from accessing the page, even with valid credentials, often due to permissions set by the website administrator. The difference lies in the root cause:<\/p><ul class=\"wp-block-list\">\n<li>A &ldquo;401 Unauthorized&rdquo; error means authentication is required or <strong>the provided<\/strong> <strong>credentials are invalid<\/strong>.<\/li>\n\n\n\n<li>A &ldquo;403 Forbidden error,&rdquo; on the other hand, means the server understands your request and knows who you are, but it&rsquo;s refusing access because <strong>you<\/strong> <strong>don&rsquo;t have the<\/strong> <strong>necessary permissions<\/strong>.<\/li>\n<\/ul><p>401 and 403 are just two of the many errors you might encounter online. If you&rsquo;d like to learn what different codes stand for and the steps to fix them, read our <a href=\"\/ng\/tutorials\/http-status-codes\">complete guide to HTTP status codes<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The &ldquo;401 Unauthorized&rdquo; error is an HTTP status code that occurs when a web server denies access to a specific web page or resource you are trying to reach. This happens because the request lacks valid authentication credentials, such as a username and password, or the provided credentials are incorrect. This error doesn&rsquo;t affect your [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/how-to-fix-the-401-unauthorized-error\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":186,"featured_media":144743,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to fix 401 error quickly with 7 effective methods","rank_math_description":"The 401 Unauthorized error is triggered by unauthenticated requests made to a WordPress web server. Learn how to identify and fix the issue.","rank_math_focus_keyword":"401 error","footnotes":""},"categories":[22630],"tags":[],"class_list":["post-36848","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical-aspects"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-fix-the-401-unauthorized-error","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/erro-401","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/comment-reparer-l-erreur-401","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/error-401","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/error-401-unauthorized","default":0},{"locale":"nl-NL","link":"https:\/\/www.hostinger.com\/nl\/tutorials\/401-error","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-fix-the-401-unauthorized-error","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-fix-the-401-unauthorized-error","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-fix-the-401-unauthorized-error","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/error-401","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/error-401","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/fqdn-8","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/erro-401","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-fix-the-401-unauthorized-error","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-fix-the-401-unauthorized-error","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-fix-the-401-unauthorized-error","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-fix-the-401-unauthorized-error","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/36848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/186"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=36848"}],"version-history":[{"count":62,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/36848\/revisions"}],"predecessor-version":[{"id":144742,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/36848\/revisions\/144742"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media\/144743"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=36848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=36848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=36848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}