Error 404 page not found wordpress

A 404 "Not Found" error occurs when your browser cannot find the requested page. This blog shares the easy fixes to bypass the 404 error on your WordPress site.

It is common that you come across the WordPress 404 or “WordPress site permalinks not working” error on your website if it is not appropriately maintained. But there are times when your website is under maintenance, and your visitors will be automatically directed to a 404 error page.

Are you facing a WordPress 404 error or a “WordPress page not found” error? Don’t freak out! We have a solution for you.

  • What is a WordPress 404 Error?
  • How to Fix 404 Error on WordPress (8 Solutions)
    1. Clear the Browsing Cache and Cookies
    2. Set Your Permalinks
    3. Restore Your .htaccess file
    4. Set Up a 301 Redirect
    5. Disabling Plugins/Themes
    6. Change and Update WordPress URL in Database
    7. Fix WordPress 404 Error on Local Servers
    8. Alternative Method
  • Conclusion

What is a WordPress 404 Error?

The 404 error is an HTTP response code that occurs when the server cannot find the file or page requested by the user. In response, the web hosting server automatically sends the user an error message, “404 Not Found“.

The WordPress 404 error commonly occurs when:

  • You’ve newly migrated your site to a new host.
  • You have changed your URL’s permalink structure and haven’t redirected the old URL.
  • You don’t have file permissions.
  • You have opened an incorrect URL.
  • Poorly coded plugin/theme.

Many WordPress themes offer creative layouts & content options to display the 404 error page. Cloudways’ 404 error has a custom design and layout too:

404 error

Managed WordPress Hosting Starting from $10/month.

Enjoy hassle-free hosting on a cloud platform with guaranteed performance boosts.

How to Fix 404 Error on WordPress (8 Troubleshooting Solutions)

This tutorial will show you how to quickly fix the 404 Not Found status code. So let’s get started!

1. Clear Browser History & Cookies

The first troubleshooting method you should try is clearing the browser cache and cookies. Or you can try to visit your site in incognito mode.

2. Set Up Your Permalink

If apart from your homepage, your other WordPress website pages give you a 404 page not found error, you can update your permalink settings by following the steps below:

  • Log in to your WordPress Dashboard.
  • Go to SettingsPermalinks.
  • Select the Default settings.
  • Click the Save Changes button.
  • Change the settings to the previous configuration (the one you selected before Default). Put the custom structure back if you had one.
  • Click Save Settings.

Note: If you use a custom structure, copy/paste it into the Custom Base section.

custom structure setting

This solution could fix the WordPress 404 not found or “WordPress permalinks not working” error.

If it doesn’t work, you’ll need to edit the .htaccess file in the main directory of your WordPress installation (where the main index.php file resides). 404 errors are also usually due to misconfigured .htaccess files or file permission-related issues.

3. Restore Your .httaccess File

Since .htaccess is a hidden file, you must set all files as visible in your FTP.

Note: It’s always recommended to backup your site before editing any files or pages.

Follow the steps below:

  • Log in to your server using an FTP client.
  • Download the .htaccess file which is located in the same location as folders like /wp-content/ wp-admin /wp-includes/.
  • Open the downloaded file in any text editor.
  • Visit the WordPress .htaccess support page and copy/paste the version of the code that is most suitable for your website.
  • Save the .htaccess file and upload it to the live server.

public folder

For example, if you have Basic WP, use the code below.

# BEGIN WordPress

RewriteEngine On

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteBase /

RewriteRule ^index.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

# END WordPress

4. Setup a 301 Redirect

If you have changed the URL of any specific page and haven’t redirected it yet, it’s time to redirect the old URL to your new URL. You may redirect your old post/page via a plugin or a .htaccess file.

If you are comfortable working with .htaccess, add the following code to your .htaccess file. Don’t forget to replace the URLs with your own website.

Redirect 301 /oldpage.html https://www.mywebsite.com/newpage.html

If you prefer the easy way, you may use a plugin to set up a 301 redirect. Follow the steps below:

  • Install the Redirection Plugin.
  • Go to the WordPress Dashboard.
  • Click Tools > Redirection.
  • Complete the setup and Add new redirection.

Redirection via plugin

5. Disabling Plugins/Theme

An outdated or poorly coded plugin may be causing the 404 error on your WordPress site. To check this, you must deactivate all your plugins and change your current theme.

Note: All WordPress themes have 404.php files but don’t necessarily have a custom 404 error template file. WordPress automatically uses the 404.php page if the 404 error occurs. 

You may access your WordPress files using an FTP like FileZilla. Go to public_html > wp-content and change the plugins folder name to something like myplugins.

Disabling Plugins

Now go back to your browser to check whether the website is working. If the error has been resolved, then any of your plugins could be the culprit.

Note: If it’s not resolved, simply change the myplugins folder name to plugins and move to the next troubleshooting method.

If it’s resolved, change the myplugins folder name to plugins and follow the steps below to check which of your plugin(s) is causing the error.

  • Go to your WordPress dashboard.
  • Go to Plugins > Installed Plugins.
  • Activate each plugin one by one and check if your website is working.
  • When you encounter the 404 error, you’d know which plugin caused it.
  • Update the plugin or remove it to get rid of the error.

WordPress plugins

6. Change and Update WordPress URL in Database

You might encounter the following error message on your WordPress website.

“The requested URL was not found on this server. If you entered the URL manually, please check your spelling and try again.”

Update WordPress URL

Fix the error by following the steps below:

  • Go to your PHPMyAdmin.
  • Navigate to your database name, and select wp-option. For example, blog > wp-option.

PHPMyAdmin

  • Change the URL, for example, from https://www.abc.com/blog/ to http://localhost/blog.

change the URL

7. Fix WordPress 404 Error on Local Servers

Many designers and developers install WordPress on their desktops and laptops using a local server for staging purposes. A common problem with local server installations of WordPress is the inability to get permalink rewrite rules to work.

You may try to change the permalinks for posts and pages, but eventually, the website shows the WordPress “404 Not Found” error.

Fixing Errors is Easier With Cloudways

Get rid of WordPress errors with a cloud hosting built to deliver a hassle-free experience with incredible speeds.

Start Free!

In this situation, turn on the rewrite module in your WAMP, XAMPP, or MAMP installation. I am using WAMP in this tutorial. Navigate to the taskbar and find the WAMP icon. After that, navigate to ApacheApache modules.

Fixing Errors

It will enable a long list of modules that you can toggle on and off. Find the one called “rewrite_module” and click it, so it is checked.

apache

Then check whether your permalinks are working or not.

8. Alternative Method

If none of the above solutions work, you may try the alternative method to fix the 404 error.

  • Navigate to the local server.
  • Find the Apache folder, then go to the “conf” folder.
  • Navigate to the httpd.conf file.
  • Search for a line that looks like:

#LoadModule rewrite_module modules/mod_rewrite.so

  • Remove the “#” sign so it looks like this:

LoadModule rewrite_module modules/mod_rewrite.so

Additional tip: PHP workers are used while executing your WordPress site’s code. An ecommerce site that gets 50,000 visitors per month needs a lot more resources than a simple blog with the same amount of traffic.

Conclusion

I hope this guide helped you solve the “WordPress 404 page error” or “WordPress permalinks not working” problem. Have you figured out any other ways to get rid of this problem? Please share your solutions with us in the comment section below.

Also, if you are a WordPress user and want to boost your site, you must try Cloudways WordPress hosting solutions and take advantage of its 3-day free trial.

Frequently Asked Questions

Q. Why am I getting a 404 error?

WordPress 404 errors usually occur when you have removed certain pages from your website and haven’t redirected them to your live pages. Sometimes, these errors may also occur when you have changed a URL of a specific page.

Q. How do I test a 404 error?

You can use multiple tools to test WordPress 404 errors, like Deadlinkchecker. Or you may access Google Analytics to find out which blogs are giving you a 404 error.

Q. How do I fix error 404 on WordPress?

You can fix the error 404 on WordPress by implementing the following solutions:

  • Clear the browser cache and cookies
  • Set your permalinks
  • Make a default .htaccess file
  • Set up a 301 redirect
  • Disable plugins and themes
  • Change and update the WordPress URL in the database
  • Fix the error on local servers

Q. How to redirect WordPress 404 pages?

Follow the steps below to redirect WordPress 404 pages:

  • Go to your WordPress dashboard.
  • Navigate to Tools > Redirection.
  • Apply redirection by pasting the broken URL in the source box and the new URL in the Target box.

Q. How to edit a WordPress 404 page?

You may edit a WordPress 404 page by following the steps below:

  • Visit your WordPress dashboard.
  • Navigate to Appearance > Theme Editor.
  • Find the file named “404.php file” and edit the file yourself or with the help of a WordPress developer.

Дек 10, 2020

Anna

7хв. читання

Ошибка 404: Как исправить в WordPress (3 метода)

Ошибка 404 в WordPress является одной из наиболее распространённых ошибок, с которой вы будете сталкиваться в интернете. Однако это не делает её менее раздражающей или неприятной, когда она появляется на вашем собственном веб-сайте. Хорошей новостью является то, что её исправление относительно простое, и процесс хорошо расписан для сайтов на WordPress.

В этой статье мы рассмотрим три способа исправления ошибки 404 в WordPress:

  1. Сброс настроек постоянных ссылок в WordPress (англ).
  2. Восстановление файла .htaccess (англ).
  3. Отключение тем и плагинов.

Однако, прежде чем закатывать рукава, мы поговорим о том, как работает ошибка 404 и какие причины её возникновения. Давайте перейдём непосредственно к этому!

Что такое ошибка 404 в WordPress (и что её вызывает)

Ошибка 404 это сообщение, которое появляется, когда вы пытаетесь получить доступ к странице, которую браузер не может найти. В зависимости от того, какой браузер вы используете, сообщение может незначительно отличаться. Например, Firefox отображает такой текст: «404 Not Found», а Chrome показывает сообщение — «404. That’s an error»:

Так выглядит ошибка 404 в Chrome

Эти сообщения об ошибках по умолчанию могут быть довольно неопределёнными, и любой веб-сайт может настроить собственную страницу ошибок 404 (англ). Это не является необходимым, но это позволяет объяснять посетителям, что сайт работает, и единственная проблема заключается в конкретной странице, которую они пытаются найти.

Независимо от того, как оно выглядит, существует много вещей, которые могут вызвать в WordPress сообщение: 404 ошибка. К ним относятся:

  • Неверный URL. В некоторых случаях ошибка может быть в дополнительной букве, набранной в URL страницы.
  • Проблемы с кэшированием. Иногда браузер может кэшировать страницу, к которой вы пытаетесь получить доступ, и пока она не найдена, вы будете видеть ошибку 404, даже если сайт работает для всех остальных.
  • Проблема с настройками сервера доменных имен (DNS). Возможно, информация о вашем домене ещё не обновилась в DNS, поэтому вы видите ошибку при попытке получить доступ к одной из страниц вашего сайта.
  • Проблемы с совместимостью в WordPress. В некоторых случаях проблемы с плагином или темой могут повлиять на то, как WordPress создаёт URL-адреса и постоянные ссылки для вашего сайта. Затем, если кто-либо попытается получить доступ к URL-адресу, который больше не работает, возникает ошибка 404 в WordPress.

Важно понимать, что ошибка 404 не уникальна только для WordPress. Она может возникать независимо от того, на какой платформе находится ваш сайт. Однако, если вы используете WordPress, у вас есть преимущество, так как существует множество способов решить эту проблему. Давайте поговорим о том, что делать, если вы столкнулись с ошибкой 404 в WordPress.

Что делать перед устранением ошибки 404 в WordPress

В следующих разделах вы будете редактировать некоторые файлы на бэкэнд WordPress. Мы проведем вас через весь процесс, и всё будет в порядке. Однако, когда вы решите редактировать конфиденциальные файлы в WordPress, лучше заранее создать резервную копию вашего сайта — на всякий случай.

Если у вас нет доступа к панели управления WordPress прямо сейчас, не волнуйтесь. В Hostinger существует несколько способов получить резервную копию вашего веб-сайта с панели управления хостингом.

Как получить резервную копию веб-сайта

После этого вам нужно будет загрузить и настроить FTP-клиент. Мы рекомендуем FileZilla (англ), так как он бесплатный и предлагает все функции, которые могут вам понадобиться. Если вы раньше не использовали FTP, вы можете ознакомиться с нашим подробным руководством о том, как получить доступ к сайту Hostinger напрямую. Затем, когда вы будете готовы, вы сможете приступить к исправлению ошибок WordPress 404.

Как исправить ошибку 404 в WordPress (3 метода)

В некоторых случаях ненайденные страницы в WordPress вскоре исчезают сами по себе. Обычно это происходит, если они вызваны ошибкой с вашим хостинг-провайдером. Прежде чем приступать к серьёзному устранению неполадок, мы рекомендуем вам попробовать обновить сайт, предоставив ему пять или десять минут, чтобы всё уладить.

Если ошибка сохраняется и дальше, значит на вашем сайте существует проблема. В этом случае давайте рассмотрим три потенциальных решения одно за другим.

1. Сбросьте настройки своих постоянных ссылок (пермалинков) в WordPress

Одной из наиболее распространённых причин ошибки WordPress 404 является проблема с тем, как WordPress генерирует ваши постоянные ссылки (англ). Как вы, возможно, знаете, WordPress предоставляет вам несколько вариантов форматирования ссылок ваших записей и страниц. Например, вы можете настроить платформу для использования простых числовых ссылок или указать название каждой записи в качестве URL-адреса:

Как переустановить постоянные ссылки

В любом случае первое, что вам нужно сделать, когда вы столкнётесь с ошибкой 404 в WordPress, это сбросить настройки ваших постоянных ссылок. Есть два способа сделать это: один через панель управления (Консоль), а другой через FTP. Если у вас есть доступ к панели управления, следуйте инструкциям в этом разделе. Еслм нет – вам следует перейти к методу номер два.

Если вы можете войти в свою панель инструментов, начните с перехода во вкладку Настройки> Постоянные ссылки. Обратите внимание на структуру, которую использует ваш сайт на данный момент. Вам нужно будет временно изменить её, чтобы сбросить настройки постоянных ссылок в WordPress, но вы измените её всего на мгновение.

Выберите параметр Простой в разделе Общие настройки и нажмите кнопку Сохранить в нижней части страницы:

Как временно изменить структуру ссылок

Страница перезагрузится. Затем вы можете продолжить и выбрать свой предыдущий тип постоянных ссылок и сохранить изменения ещё раз. Это всё, что требуется для сброса структуры ссылок на WordPress.

Теперь попробуйте просмотреть свой веб-сайт как обычно. Проверьте страницы, которые ранее выдавали ошибку 404. Если ошибка ушла, вы молодец – вам понадобилось минимум времени, чтобы её исправить!

2. Восстановите файл .htaccess в WordPress.

Когда вы вносите изменения в структуру постоянной ссылки в WordPress, они сохраняются в файл под названием .htaccess (англ). Этот файл определяет, как WordPress будет взаимодействовать со своим сервером, а также способ создания URL-адресов для страниц.

Если у вас нет доступа к панели управления, вам нужно будет вручную отредактировать .htaccess, чтобы переустановить постоянные ссылки. Чтобы начать работу, зайдите на свой сайт через FTP и перейдите в корневую папку WordPress. Это каталог, который содержит установку WordPress и обычно находится в папке public_html или www или назван в честь вашего сайта:

Как найти корневую папку WordPress

Откройте эту папку и найдите файл .htaccess. Если вы используете FileZilla, вам нужно щёлкнуть правой кнопкой мыши по файлу .htaccess и выбрать параметр Просмотреть / Изменить. Это означает, что вы загружаете копию файла на свой компьютер и открываете его с помощью локального текстового редактора по умолчанию. Теперь вы сможете внести любые изменения, которые вам нужны.

Если вы не понимаете, для чего нужен весь код в этом файле, не беспокойтесь. Вы не должны вносить в него никаких изменений, если вы не уверены в них на 100 %. Однако, что вы можете сделать, так это использовать код WordPress .htaccess, который выглядит следующим образом:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Это чистый файл .htaccess без каких-либо изменений. Он удалит любые изменения, внесённые в вашу структуру постоянной ссылки. Идём дальше и создаём резервную копию содержимого старого файла .htaccess и заменяем его фрагментом кода, указанного выше.

После этого сохраните изменения в файле .htaccess с помощью текстового редактора и закройте его. FileZilla спросит, хотите ли вы заменить существующий файл .htaccess копией, которую вы только что отредактировали. Согласитесь на это действие, и всё! Вы просто переустанавливаете свои постоянные ссылки WordPress вручную, не нарушая ничего в этом процессе.

На этом этапе попробуйте снова вернуться на ваш сайт. Ошибка 404 должна исчезнуть, что уже является отличной новостью. Тем не менее, вы по-прежнему можете вернуть предыдущую структуру постоянных ссылок, если вам не нравятся числовые URL-адреса.

Помните, что вы можете изменить способ просмотра ваших постоянных ссылок, перейдя в панель управления и во вкладку Настройки> Постоянные ссылки. Выберите структуру, которую использовал ваш сайт до ошибки 404, и сохраните изменения. Тогда всё должно вернуться к нормальному функционированию.

3. Отключите темы и плагины в WordPress.

Как уже упоминалось ранее, иногда ваши плагины и темы могут влиять на структуру вашего WordPress, в зависимости от их настроек. Если вы попробовали один или оба предыдущих метода и ошибка 404 по-прежнему сохраняется, отключите свои темы и плагины.

Есть два способа сделать это, в зависимости от того, имеете ли вы доступ к панели управления или нет. Если у вас есть доступ, перейдите во вкладку Плагины> Все плагины и выполните этот процесс для каждого из ваших плагинов:

  1. Нажмите кнопку Деактивировать под именем плагина.
  2. Проверьте свой сайт, чтобы узнать, сохраняется ли ошибка 404.
  3. Если ошибка всё ещё существует, повторно активируйте отключённый плагин.
  4. Перейдите к следующему плагину в списке и повторите процесс.

Ваша цель – отключать каждый плагин один за другим. Вы можете отключить их всех сразу, но в большинстве случаев всего один плагин вызывает проблемы. Если отключение одного из ваших плагинов устраняет проблему, у вас есть три варианта. Вы можете проверить, есть ли доступное обновление, и временно отключить плагин до тех пор, пока оно не появится, или вы не замените плагин на альтернативный.

Если вы проверили все свои плагины, и ни один из них не оказался причиной проблемы, вам также придётся убедиться, что ваша активная тема не приводит к ошибке 404. Этот процесс намного быстрее, так как вам нужно проверить всего одну тему. Перейдите на вкладку Темы и переключите свою активную тему на какую-нибудь другую:

Как временно изменить тему

Теперь проверьте, не исчезла ли ошибка 404. Если да, то вам снова нужно выбирать между поиском обновления или поиском новой темы. Переключение тем в WordPress может быть немного хлопотным, но в конечном итоге это необходимо, раз уж ваша текущая тема приводит к ошибкам.

Если у вас нет доступа к панели управления, вы можете отключить тему и плагины вручную через FTP. Чтобы сделать это, зайдите на свой сайт с помощью FileZilla, затем перейдите в каталог public_html / wp-content. Здесь вы найдёте несколько папок, две из которых называются plugins и themes соответственно:

Как отключить плагины или тему вручную

Сначала зайдите в каталог плагинов. Вы заметите, что для каждого плагина есть своя папка. Выберите одну из этих папок, щёлкнув по ней правой кнопкой мыши и выберите опцию Переименовать:

Как переименовать папку

Измените название папки на что-то вроде akismet.disabled, так чтобы вы смогли легко её идентифицировать. Простого изменения названия папки плагина достаточно для того, чтобы WordPress его отключил. Теперь проверьте, не исчезла ли ошибка 404. Если нет, верните этой папке прежнее название и повторите этот процесс для каждого следующего плагина в папке.

Если один из ваших плагинов стал причиной ошибки, вы знаете, как с этим справиться. Однако, если окажется, что ошибка 404 возникает не из-за них, вы можете перейти в каталог тем wp-content> themes. Найдите папку с активной темой и переименуйте её так же, как и плагины:

Как переименовать папку тем

Поскольку WordPress всегда нуждается в активной теме, отключение вашей приведет к тому, что платформа будет использовать один из готовых вариантов по умолчанию. Это может повлиять на внешний вид вашего веб-сайта, но не беспокойтесь, это временно.

Если ошибка исчезла, вам может потребоваться подобрать новую тему. Однако, если это не так, восстановите предыдущее название папки своей темы, чтобы WordPress снова её распознал.

Дополнительная информация

Ошибка 404 это не единственная проблема, которая может возникнуть с веб-сайтом в WordPress. Вот список наиболее популярных ошибок в WordPress с углублённой информацией о том, как их исправлять:

  • Как исправить ошибку 403 Forbide Error в WordPress
  • Как исправить ошибку 500 Internal Server Error в WordPress
  • Ошибка 502 Bad Gateway в WordPress – причины и как исправить
  • Как отладить и исправить ошибку 503 Service Unavailable в WordPress
  • Ошибка 504 Gateway Time-out и как её исправить в WordPress
  • Как исправить ошибку HTTP при загрузке изображений в WordPress
  • Как исправить ошибку «Извините, вы не можете получить доступ к этой странице» в WordPress

Вывод

Ошибка 404 может показаться простой, но она может нанести большой урон. Если ваши посетители не могут найти нужные им страницы, они могут начать искать в другом месте, а зачем вам это? Это означает потерянный трафик и, возможно, снижение конверсий.

К счастью, есть много способов решить эту проблему в WordPress, включая отключение тем и плагинов, восстановление вашего файла .htaccess и сброс ваших постоянных ссылок.

Если у вас возникли какие-либо вопросы, советы или рекомендации по работе с ошибкой WordPress 404 – давайте поговорим о них в разделе комментариев!

Author

Анна долгое время работала в сфере социальных сетей и меседжеров, но сейчас активно увлеклась созданием и сопровождением сайтов. Она любит узнавать что-то новое и постоянно находится в поиске новинок и обновлений, чтобы делиться ими с миром. Ещё Анна увлекается изучением иностранных языков. Сейчас её увлёк язык программирования!

You’ve likely seen the “Page Not Found” error before. Unfortunately, if you operate a website of any sort (WordPress or not), the day will probably come when you see the message on one of your own pages.

Fortunately, like many common WordPress errors, 404s are relatively easy to troubleshoot and fix. The solution usually involves restoring your site’s permalink structure — something you can do in just a few minutes.

In this article, we’ll explain just what a 404 error is and what can cause one on your site. Then we’ll walk you through how to fix it in four simple steps. Let’s get started!

An Overview of the WordPress 404 Error

A 404 error, also known as a “Page Not Found” error, indicates that your browser can’t locate the page you’re trying to access. The exact message can look a bit different depending on the browser you’re using, but it will generally always contain either the “404” code or a “page not found” message of some kind.

DreamHost Glossary

404 Error

A 404 error is an HTTP status code that indicates that the page a user is trying to access does not exist. 404 errors can occur for a wide variety of reasons, but they almost always lead to a poor User Experience (UX).

Read More

Websites can also create their own custom 404 pages.

A custom 404 error page.

Seeing this notification (or any other error message) when you’re trying to access your site can be frustrating. While there is a chance that your post has actually gone missing, the vast majority of the time, there’s a more benign cause.

Some common reasons that WordPress posts might return 404 errors include:

  • A mistyped URL. It could simply be attributed to a typo in the URL. This is the most common cause.
  • An issue with your Domain Name System (DNS) settings. If you’ve recently updated any of your DNS information and you’re seeing this error, it could be because the changes haven’t propagated fully. It can take up to 48 hours for this process to complete.
  • Problems with the permalink structure of your site. Permalink problems can be caused by a missing, broken, or corrupted .htaccess file. Compatibility issues with WordPress components such as plugins and themes could also be the culprit.

Regardless of the cause, this error prevents access to your site, so it needs to be resolved as quickly as possible. We’ll look at troubleshooting and resolving the problem shortly.

Skip the Stress

Avoid troubleshooting when you sign up for DreamPress. Our friendly WordPress experts are available 24/7 to help solve website problems — big or small.

Why 404 Errors Matter

404 errors pose several problems for a website, beyond simply preventing you from accessing pages. First, they create a poor User Experience (UX).

If there are many of these errors on your site, and they aren’t resolved quickly, they could eventually turn users away. In the worst-case scenario, those visitors could land on a competing website instead, costing you business.

404 errors can also hurt your Search Engine Optimization (SEO). Search engine crawlers won’t index a page that returns a 404 because they think it doesn’t exist.

What to Do Before Troubleshooting the WordPress 404 Error

Before changing your permalink settings or .htaccess file, it’s a smart idea to create a backup of your website and database. This way, if you accidentally make something worse, you can easily restore your site to a functioning state.

If your website is hosted with DreamPress, backups couldn’t be easier. DreamPress automatically backs up your entire site every day, so you always have a fresh copy to access. You can also create a manual backup with just a few clicks.

How to Fix WordPress Posts Returning 404 Error (In 4 Steps)

With a fresh backup of your site in hand, it’s time to get to work. You’ll want to follow these steps in order and check if the error has been resolved after each one.

Step 1: Reset Your WordPress Permalinks

The first step to try is resetting your permalinks. Head to your WordPress dashboard and navigate to Settings > Permalinks.

The WordPress Permalink Settings page.

From here, just click on Save Changes. That’s right — you don’t actually need to edit anything. Clicking that button will update the permalink settings even if you don’t make any changes. This is important because it also refreshes the rewrite rules used for “pretty permalinks.”

With this done, go ahead and reload the pages you were trying to access. If everything works, you’re all done. If you still get a 404 error, head to the next step.

Step 2: Restore Your .htaccess File

If resetting your permalinks didn’t work, the next strategy is restoring your .htaccess file. This controls how WordPress interacts with the server and how it generates permalinks for your pages. Restoring it to the default settings can fix sudden 404 errors.

To restore the .htaccess file, you’ll first need a way to access it. If you’re using DreamPress hosting, you can use the built-in file manager found in the DreamHost control panel. Most other web hosts offer a similar feature, or you can use a Secure File Transfer Protocol (SFTP) client such as FileZilla. We have detailed instructions for connecting via SFTP if you need help.

For this example, we’ll use the DreamHost file manager. Head to your DreamHost panel and navigate to WordPress > Managed WordPress in the sidebar.

The DreamPress domain settings page.

Find the domain you’re having trouble with and click on the blue Manage button. On the next page, make sure the Details tab is selected at the top, and then click on Manage Files.

The DreamHost file manager.

This will open the file manager in a new tab. Locate and click on the folder that corresponds to your domain name. You’ll find the .htaccess file in this directory (it’s the same one that contains items such as wp-content).

The location of the .htaccess file in the WordPress root folder.

Next, click on the file name and select Edit from the list of options. You can copy the current contents of the file and paste them somewhere for safekeeping. For now, you’ll want to replace the contents with the following:

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

# END WordPress

This is the default .htaccess file for WordPress. When you’ve pasted this in, go ahead and save the file.

Restoring this file will also reset the permalink settings for your WordPress site. Therefore, if you’re using a custom permalink structure (or have changed it at all from the default), you’ll need to restore that setting too.

To do so, head back to your WordPress dashboard and navigate to Settings > Permalinks (just like Step 1 above). You can change it to whatever you were using before and then save it.

Finally, refresh your website and attempt to load the pages that were returning 404 errors. If everything works now, congratulations! If not, proceed to the next step.

Step 3: Disable All of Your WordPress Plugins and Theme

If you’ve reset your permalinks and .htaccess file, but you’re still seeing 404 errors on your site, the next step is to check your plugins and theme. Plugins, in particular, can sometimes have bugs or compatibility issues that prevent a site from loading.

Let’s start there. The basic idea is to disable them one by one and then check your website. If the error persists, turn it back on and move to the next one.

To get started, head to your WordPress dashboard and navigate to Plugins > Installed Plugins.

The ‘deactivate’ button on the WordPress plugin settings page.

Locate and click on the Deactivate button below the first plugin. You can see that active plugins are shaded blue, while those that are off are white (as you can see with Akismet in the screenshot above). Now, refresh your site and see if the 404 error is still occurring.

If you get the error message, head back to the plugins screen, re-activate the plugin you just tried, and move to the next one in the list. If you find one that resolves the issue, you can check for updates that may resolve the problem or find an alternative with similar functionality.

If none of the plugins prove to be the issue, it’s time to try changing your theme. Head to Appearance > Themes.

The WordPress theme manager.

Your currently-active theme is marked as such. Hover over one of the others and click on Activate. Then refresh your site and try to access the problematic page again.

Note that changing your theme can alter your site significantly. So if you find that your theme is the issue, you may need to spend some time finding one that provides a similar look and features.

Step 4: Set Up a 301 Redirect for Moved or Renamed Content

This one is a bit of a bonus step. If you do actually have content that’s been moved or renamed and thus doesn’t exist anymore at the URL you were using previously, you’ll want to set up some 301 redirects to point that old URL to the new one.

The easiest way to do this is with a WordPress plugin such as Redirection.

The Redirection WordPress plugin for managing 30 redirects.

This tool will enable you to quickly set up the redirects you need. Plus, it’s free and user-friendly.

How to Create Your Own “Error 404 Not Found” Page

If you want to set up your own custom 404 error page, you can do so relatively easily. The process involves adding one line to the .htaccess file to point the error to a specific page and then creating that page. We have full instructions for setting up a custom error page to walk you through the process.

Get Content Delivered Straight to Your Inbox

Subscribe to our blog and receive great content just like this delivered straight to your inbox.

Tools to Help You Monitor 404 Errors Moving Forward

Finally, if you want to keep an eye out for 404 errors in the future, you can use a few handy tools. The Google Search Console will show you crawl errors that the Google bots have come across as they index your site. This is a simple way to see all the issues Google is encountering.

You can also enter your URL into a specialized tool such as the Broken Link Checker, which will scan your entire site for broken links and let you know if it finds a 404 page.

The Broken Link Checker tool for finding 404 errors on your website.

It’s free and easy to use. You can simply input your domain and then click on Check Site.

More WordPress Error Tutorials

Want to learn how to fix other common WordPress errors? We’ve created a series of guides to help!

  • How to Fix the 500 Internal Server Error in WordPress
  • How to Fix Syntax Errors in WordPress
  • How to Fix the WordPress Not Sending Email Issue
  • How to Fix the Error Establishing Database Connection in WordPress
  • How to Fix the Sidebar Below Content Error in WordPress (In 3 Steps)

Ready to Find That Missing WordPress Post?

A 404 error can be frustrating — especially when it happens on your own site. These messages cause problems with SEO and ruin your site’s UX. Fortunately, they’re not too difficult to resolve.

Fixing 404 pages generally involves restoring your site’s permalink structure and setting up redirects for any posts that are actually gone. You can then use tools such as Google Search Console to monitor your site for future 404s.

If you want to spend less time dealing with errors, consider switching to DreamPress, our managed WordPress hosting service. We’ll take care of all the troubleshooting for you, so you can focus on what matters!

Languages:
English
Creating an Error 404 Page 日本語
(Add your language)

While you work hard to make sure that every link actually goes to a specific web page on your site, there is always a chance that a link clicked will slam dunk and become a famous 404 ERROR PAGE NOT FOUND.

All is not lost. If your visitors encounter an error, why not be a helpful WordPress site administrator and present them with a message more useful than «NOT FOUND».

This lesson will teach you how to edit your «error» and «page not found» messages so they are more helpful to your visitors. We’ll also show how to ensure your web server displays your helpful custom messages. Finally, we’ll go over how to create a custom error page consistent with your Theme’s style.

Contents

  • 1 An Ounce of Prevention
  • 2 Understanding Web Error Handling
  • 3 Editing an Error 404 Page
  • 4 Creating an Error 404 Page
  • 5 Tips for Error Pages
    • 5.1 Writing Friendly Messages
    • 5.2 Add Useful Links
  • 6 Testing 404 Error Messages
  • 7 Help Your Server Find the 404 Page
  • 8 Questions About Error Files

An Ounce of Prevention

Some errors are avoidable, you should regularly check and double check all your links. Also, if you are deleting a popular but out-of-date post, consider deleting the body of the post, and replacing it with a link referring visitors to the new page.

Understanding Web Error Handling

Visitors encounter errors at even the best websites. As site administrator, you may delete out-of-date posts, but another website may have a link to your inside page for that post.

When a user clicks on a link to a missing page, the web server will send the user an error message such as 404 Not Found. Unless your webmaster has already written custom error messages, the standard message will be in plain text and that leaves the users feeling a bit lost.

Most users are quite capable of hitting the back key, but then you’ve lost a visitor who may not care to waste their time hunting for the information. So as not to lose that visitor, at the very least, you’ll want your custom message to provide a link to your home page.

The friendly way to handle errors is to acknowledge the error and help them find their way. This involves creating a custom Error Page or editing the one that came with your WordPress Theme.

Editing an Error 404 Page

Every theme that is shipped with WordPress has a 404.php file, but not all Themes have their own custom 404 error template file. If they do, it will be named 404.php. WordPress will automatically use that page if a Page Not Found error occurs.

The normal 404.php page shipped with your Theme will work, but does it say what you want it to say, and does it offer the kind of help you want it to offer? If the answer is no, you will want to customize the message in the template file.

To edit your Theme’s 404 error template file, open it in your favorite text editor and edit the message text to say what you want it to say. Then save your changes and upload it to the theme directory of your WordPress install.

While you are examining and editing your 404 template file, take a look at the simple structure of the 404.php file that is shipped with Twenty Thirteen. It basically features tags that display the header, sidebar, and footer, and also an area for your message:

<?php
/**
 * The template for displaying 404 pages (Not Found)
 *
 * @package WordPress
 * @subpackage Twenty_Thirteen
 * @since Twenty Thirteen 1.0
 */

get_header(); ?>

	<div id="primary" class="content-area">
		<div id="content" class="site-content" role="main">

			<header class="page-header">
				<h1 class="page-title"><?php _e( 'Not Found', 'twentythirteen' ); ?></h1>
			</header>

			<div class="page-wrapper">
				<div class="page-content">
					<h2><?php _e( 'This is somewhat embarrassing, isn’t it?', 'twentythirteen' ); ?></h2>
					<p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentythirteen' ); ?></p>

					<?php get_search_form(); ?>
				</div><!-- .page-content -->
			</div><!-- .page-wrapper -->

		</div><!-- #content -->
	</div><!-- #primary -->

<?php get_footer(); ?>

So, to change the error message your visitor sees, revise the text within the h1 heading and within the page-content class; if necessary, add more paragraphs below that.

Creating an Error 404 Page

If your WordPress Theme does not include a template file named 404.php, you can create your own.

Because every theme is different, there is no guarantee that copying over the 404.php template file found in the Twenty Thirteen Theme will work, but it’s a good place to start. The error page you copy from the Twenty Thirteen Theme will adopt the style of the current theme because it actually calls the header and footer of the current theme. That’s less work for you, and you may only have to edit the message to suit your particular needs.

To use the 404.php template file from the WordPress Twenty Thirteen Theme:

  1. Copy the file /wp-content/themes/twentythirteen/404.php into the directory of your current theme.
  2. Then, as described in the previous section, edit the error message to present your desired error message.

If copying the default 404.php into your theme directory does not work well with your theme, you can also:

  • Change the Default Theme’s 404.php template file’s header, sidebar, footer, and other codes to match the rest of the Theme’s layout.

Or

  • Copy the index.php file of your current theme to a file called 404.php.
  • Open that file and delete all sections dealing with posts or comments, see The Loop.
  • Then, edit your 404 error message.

Tips for Error Pages

There are various improvements you can make to your 404 Error web pages so let’s look at some of your options.

Writing Friendly Messages

When an error message is displayed, you can say many things to help a visitor feel reassured they’ve only encountered a minor glitch, and you’re doing the best you can to help them find the information they want. You can say something clever like:

"Oops, I screwed up and you discovered my fatal flaw. 
Well, we're not all perfect, but we try.  Can you try this
again or maybe visit our <a 
title="Our Site" href="http://example.com/index.php">Home 
Page</a> to start fresh.  We'll do better next time."

You should also attempt to show the user what they want. Check out the AskApache Google 404 Plugin to add google search results to your 404.php

Or, say something shorter and sweeter. Almost anything you say is better than 404 Error Page Not Found. You can find more information about writing 404 Error pages on the Internet, like List Apart’s Perfect 404.

As an implementation of the Perfect 404 page, this solution will tell the user it’s not their fault and email the site admin.
Helpful 404 page

When a visitor gets a 404 error page, it can be intimidating, and unhelpful. Using WordPress, you can take the edge off a 404 and make it helpful to users, and yourself, too, by emailing whenever the user clicks a link to a non-existent page.

<p>You 
<?php
#some variables for the script to use
#if you have some reason to change these, do.  but wordpress can handle it
$adminemail = get_option('admin_email'); #the administrator email address, according to wordpress
$website = get_bloginfo('url'); #gets your blog's url from wordpress
$websitename = get_bloginfo('name'); #sets the blog's name, according to wordpress

  if (!isset($_SERVER['HTTP_REFERER'])) {
    #politely blames the user for all the problems they caused
        echo "tried going to "; #starts assembling an output paragraph
	$casemessage = "All is not lost!";
  } elseif (isset($_SERVER['HTTP_REFERER'])) {
    #this will help the user find what they want, and email me of a bad link
	echo "clicked a link to"; #now the message says You clicked a link to...
        #setup a message to be sent to me
	$failuremess = "A user tried to go to $website"
        .$_SERVER['REQUEST_URI']." and received a 404 (page not found) error. ";
	$failuremess .= "It wasn't their fault, so try fixing it.  
        They came from ".$_SERVER['HTTP_REFERER'];
	mail($adminemail, "Bad Link To ".$_SERVER['REQUEST_URI'],
        $failuremess, "From: $websitename <noreply@$website>"); #email you about problem
	$casemessage = "An administrator has been emailed 
        about this problem, too.";#set a friendly message
  }
  echo " ".$website.$_SERVER['REQUEST_URI']; ?> 
and it doesn't exist. <?php echo $casemessage; ?>  You can click back 
and try again or search for what you're looking for:
  <?php include(TEMPLATEPATH . "/searchform.php"); ?>
</p>

Add Useful Links

If you encounter a «page not found» situation on the WordPress site, it is filled with helpful links to direct you to the various categories and areas of information within the WordPress site. Check it out at http://wordpress.org/brokenlink.php.

To add similar useful links to your 404 page, create a list, or a paragraph, so the visitor can easily determine which section might be useful to visit. Information of that nature is much better than having the user just reach a dead-end. To help you understand how to link to documents within your site, especially to Pages and Categories, see Linking_Posts_Pages_and_Categories.

Testing 404 Error Messages

To test your custom 404 page and message, just type a URL address into your browser for your website that doesn’t exist. Make one up or use something like:

http://example.com/fred.php

This is sure to result in an error unless you actually have a php file called fred. If your error page doesn’t look «right», you can go back and edit it so it works correctly and matches your Theme’s look and feel.

Help Your Server Find the 404 Page

By default, if WordPress cannot find a particular page it will look for the 404.php web page. However, there may be cases where the web server encounters a problem before WordPress is aware of it. In that case, you can still guarantee that your web server sends the visitor to your 404.php template file by configuring your web server for custom 404 error handling.

To tell your web server to use your custom error files, you’ll need to edit the .htaccess file in the main directory (where main index.php file resides) of your WordPress installation. If you don’t have an .htaccess file, see Editing Rewrite Rules (.htaccess) on how to create an .htaccess file.

To ensure the server finds your 404 page, add the following line to your .htaccess file:

ErrorDocument 404 /index.php?error=404

The url /index.php is root-relative, which means that the forward slash begins with the root folder of your site. If WordPress is in a subfolder or subdirectory of your site’s root folder named ‘wordpress’, the line you add to your .htaccess file might be:

ErrorDocument 404 /wordpress/index.php?error=404

Questions About Error Files

Why not just hard code the path all the way to the 404.php file?
By allowing index.php to call the error file, you ensure that the 404.php file used will change automatically as you change your theme.
What happens if I switch to a theme that does not have a 404.php file?
Visitors clicking on a broken link will just see a copy of the home page of your WordPress site (index.php), but the URL they see will be the URL of the broken link. That can confuse them, especially since there is no acknowledgement of the error. But this is still better than a getting a «NOT FOUND» message without any links or information that could help them find what they seek.

Updated on February 2, 2023

How to fix WordPress error 404 page not found

WordPress 404 Error Page Not Found

Table of Contents [TOC]

  • WordPress 404 Error Page Not Found
    • ⭐ What is the Error 404 Not Found?
    • ⭐ What Causes A WordPress 404 Error?
    • ⭐ Error 404 Not Found Variations
    • ⭐ Negative Impact Of 404 Errors
      • Do 404s Hurt SEO and Rankings of a Website?
    • ⭐ How to Fix Error 404 Page Not Found in WordPress?
    • WordPress 404 Error – Internet Explorer Cannot Display The Webpage
    • “The requested URL was not found on this server
    • Fix WordPress 404 Not Found Error on Local Server
    • How to Create Your Own Error 404 Not Found Page
    • Tools to Check/Monitor 404 Errors WordPress?
    • Like this:
    • Related

Introduction –

Are you getting WordPress 404 Page Not Found Error and “WordPress Site Permalinks Not Working” Error?

The WordPress 404 error occurs when the server cannot find the requested file or page, and the user is directed to a “404 Not Found” error message. It commonly happens when a site is newly migrated to a new host, the permalink structure is changed, there are incorrect file permissions, an incorrect URL is opened, or there is a poorly coded plugin/theme.

To fix the 404 error on WordPress, there are various troubleshooting meathods. These include clearing browser history and cookies, setting up the permalink, restoring the .htaccess file, setting up a 301 redirect, disabling plugins/theme, checking the URL, updating the .php file, and contacting the hosting provider.

Lets talk aboiut these in a detailed way, but before that lets go over the basics for a better understanding.


There can be multiple case scenarios like:

  • Is your WordPress showing 404 page not found error?
  • Showing 404 error after publishing or changing permalinks?
  • WordPress page is not found but it exists?

404 not found error in WordPress depicts that the server fails to locate the requested posts or pages in your site. Such errors may arise unpredictably or can occur after certain adjustments or improvements that are made to the WordPress site. Those improvements can be a theme change, changed permalinks, missing file or directory in WordPress etc.

In this article, you will learn about how to solve the 404 page not found error on your wordpress site and make website content accessible to you. Simply follow the steps mentioned below 🙂

These error messages can arise from many reasons. Often, a WordPress page returning 404 error occur due to the management of the site such as the deletion of a page or an article without any redirection.

The probability of such issues is maximum during the migration or redesign of the website.

This can also happen during the migration or redesigning of a site. In this case, the URLs may have changed or been rewritten and have not been correctly redirected to the new URLs.

Like the 500 internal server error or error establishing database connection. WordPress showing a Error 404 Not Found is another common problem that most WordPress users face at some point.

Other Common WordPress errors

  • WordPress White Screen of Death (WSOD) Error
  • 503 Service Unavailable Error WordPress
  • WordPress HTTP Image Upload Error
  • WordPress File And Folder Permissions Error
  • Pluggable.php File Errors in WordPress
  • Upload: Failed to Write File to Disk” WordPress Error
  • Parse Error: Syntax Error Unexpected in WordPress

Are you encountering frequent website issues?

Our WordPress experts can help you Fix WordPress errors?👍


⭐ What is the Error 404 Not Found?

Who has never faced this problem? You do a search on the Internet from your favorite search engine, Google, Bing, and trust it as to the site on which you will land; or else click on a link from a site you are currently looking at hoping to continue reading or benefit from a product or service and there it is, drama!

The browser displays one of the messages that we saw above or another of the same style: Error 404 page not found or 404 Page Not Found.

⭐ What Causes A WordPress 404 Error?

Some common causes of 404 errors.

  • A mistyped URL.
  • Caching problems.
  • An issue with your Domain Name Server (DNS) settings.
  • WordPress compatibility issues.

If you happen to get this error on the entire site’s content, it is generally because of a problem in WordPress site’s permalinks. Whereas, if you find it on some specific pages, it is most often a result of changing some part of the content’s slug without fixing a redirect.

When this is the case for a page on a website (or any document), it means that the content accessible at the Web address URL you have just accessed does not exist or no longer exists. The difference between the two can sometimes help a user find the right URL if they use common sense.

Let’s take an example, to show that if the message corresponds to content that does not exist – if you really want to access the content – sometimes get there all the same. A few days ago, I was browsing a website that linked to another one (or rather thought it was).

Unfortunately, this link (which would have been much appreciated for the site that received it) started in the following way: http : // www  . In this case (this is not always true) the webmaster was most likely well-intentioned, except that he went too fast.

Result of the webmaster’s mistake, when clicking on the link, the site was obviously inaccessible. Frustrating for the user (in this case here, me) and the webmaster of the site who would have received the link if the latter had been inserted correctly.

As a webmaster, you went too fast in making internal link and in a case like this, you need to correct the link as soon as possible because it may risk losing a very large majority of visitors (and sales who go with it) who are not necessarily going to bother doing what we just mentioned or trying to access your product page (or blog article or other) by another means.

The consequences can be very unfortunate for both the traffic on the site and for the turnover of an online store, you must be vigilant and watch this closely to correct the error 404 as soon as it occurs.

To be able to monitor all this, the Google Search Console will be ideal, and to save time in corrective actions, we strongly advise you to use 404 broken link finder tools mentioned below in this article.

⭐ Error 404 Not Found Variations

Because each web browser displays error messages differently, you might see a different message for this error. Other common variations include:

  • Error 404
  • 404 Not Found
  • HTTP Error 404
  • 404 – file or directory not found. wordpress
  • ERROR 404. PAGE NOT FOUND On WordPress site
  • The requested URL was not found on this server.
  • The page cannot be found
  • We can’t find the page you’re looking for.
  •  the requested url was not found on this server. wordpress

The Error 404 not found message is treated suitably by many sites that fetch a custom page to cover the error and not just show one of the typical messages above.

Therefore, a visitor may not experience the error message at all since many sites rather deploy interesting or creative 404 pages.

404 error is problematic for your users’ experience but also harmful for your SEO positioning.

⭐ Negative Impact Of 404 Errors

More specifically, where a permalink issue is causing sitewide 404 errors, Google crawlers’ wont be able to penetrate through and index the site’s content. Consequently, one should immediately resolve 404 errors. There are a lot of experts out there stating that 404s will ruin your rankings and that you should fix them as soon as possible.

In addition to losing visitors who do not find what they are looking for, are giving negative signals to Google. First, it slows down Google robots, which then give less importance to your site.

In addition, if a page receives good quality external links and it no longer exists, all the popularity of the links is no longer transmitted correctly to the entire site. 404s have an impact on rankings. But not the rankings of a whole site. If a page returns a 404 error code, it means it doesn’t exist, so Google and other search engines will not index it. Pretty simple, right?

Do 404s Hurt SEO and Rankings of a Website?

You can discover 404 errors in Google Search Console or by installing a third-party plugin like Redirection which lists 404 errors.

If a user arrives on a page of a site with a 404 error via an internal link, an external link or even via social networks, he will be frustrated not being able to access the content he wanted to see.

This can give an unprofessional image to a brand and cause a future rejection on the part of the Internet user who will remember this bad experience.

⭐ How to Fix Error 404 Page Not Found in WordPress?

Because this error discloses inconsistency with a link, it can typically resolve the same by properly configuring and saving WordPress permalinks. You should also correct the linking structure using a .htaccess file.

1. Save Permalinks

It is a simple solution to fix 404 error in WordPress by saving WordPress permalinks. This will update .htaccess file with the correct configurations for WordPress website.

To save permalinks, login to WP dashboard and go to Settings > Permalinks.

how to fix wordpress posts returning 404 error

Then, scroll down and click on Save Changes.

fix error 404 not found on wordpress site

Now try accessing the posts to see if the 404 error is fixed.

2. Manually Reset Permalinks

If saving the permalinks did not solve the 404 issues, then you can manually reset permalinks by editing the .htaccess file.

To do this, access WordPress files using FTP. When connected via FTP, locate .htaccess file and edit it.

wordpress 404 error after changing permalinksAdd in one of the following codes, save, and upload the updated file to your server:

A) When WordPress Site in the Main Domain

If site is on the main domain, e.g. www.yoursite.com, add this code to .htaccess file:

# BEGIN WordPress
 <IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteRule ^index.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
 </IfModule>
 # END WordPress

After editing and uploading a new file, refresh your site and access posts/pages to see if this fixes the 404 issues.

B) If WordPress Site in a Subdomain

If your site is installed in a subdomain, such as blog.yoursite.com, use this code instead.

RewriteEngine On
 RewriteBase /
 RewriteRule ^index.php$ - [L]
 RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
 RewriteCond %{REQUEST_FILENAME} -f [OR]
 RewriteCond %{REQUEST_FILENAME} -d
 RewriteRule ^ - [L]
 RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
 RewriteRule ^(.*.php)$ $1 [L]
 RewriteRule . index.php [L]

C) When WordPress in subdirectory

If your site is on a subdirectory, such as www.yoursite.com/blog, edit .htaccess to include this code instead.

RewriteEngine On
 RewriteBase /
 RewriteRule ^index.php$ - [L]
 RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
 RewriteCond %{REQUEST_FILENAME} -f [OR]
 RewriteCond %{REQUEST_FILENAME} -d
 RewriteRule ^ - [L]
 RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
 RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
 RewriteRule . index.php [L]

3. Set Up 301 Redirects for Moved or Renamed Content

The 301 redirect is the most effective solution for correcting 404 errors on your site. However, it must be done correctly, making sure to redirect to the right pages as appropriate:

  • The page with error 404 has been replaced on the site by a new page which has a different URL: We are redirecting directly to this new page.
  • The page with error 404 has not been replaced on the site: We are redirecting to a page with similar content. If no similar content exists, it is also possible to redirect to the category page of the old content. As a last resort, redirect to the home page (Do not do this systematically).
  • Before deleting a page and redirecting, be sure to check if it has backlinks (external links), visits and if it is still well-positioned in Google.

To begin, you can take the help of a free Redirection plugin to fix redirects from your WordPress dashboard. After installing and configuring the plugin, visit the “Tools” menu and select “Redirection” and then type the 404 page URL in the “Source URL” box and the new working URL in the “Target URL” box.

how to fix wordpress error 404 page not found

If you use a CMS like WordPress, it is possible to use a plugin like this one. It allows automatic redirection by indicating the old and the new URL without going through the .htaccess file.

Implementing 301 Redirects Manually

Manually in the .htaccess of your hosting panel, using the piece of code:

  • To 301 Redirect a Page:

RedirectPermanent /old-file.html http:// www.domain.com/new-file.html

  • To 301 Redirect an Entire Domain:

RedirectPermanent / http:// www.new-domain.com/

Once you have inserted the commands to 301 redirect your pages, you need to make sure that there is a blank line at the end of the file. Your server will read the .htaccess file line by line, which means you need to throw an “end line” character to signify that you’re finished. An easy way to do this is to put a blank line at the bottom of the file.

Now that you’ve cleaned up your 404 errors, you can now anticipate this type of problem by creating a well-designed custom 404 page. You can in particular take inspiration from Google which offers creations all more original than the others.

Edit .htaccess

You need to edit the .htaccess file (and add a snippet of code at the top) which can be done in a number of ways. You can either get it done through an FTP program’s edit mode or edit the file on your PC and then upload it to the server via FTP or you can do this via cPanel >> File Manager.

This is the code:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# End WordPress

WordPress 404 Error – Internet Explorer Cannot Display The Webpage

Sometimes your WordPress website works fine on other web browsers, except Internet Explorer. Indeed, IE ignores the 404 conditions since the dawn of IE.

However, a few weeks ago, Microsoft introduced a system update for IE7 and IE8 which can cause the 404 error to stop immediately on your website, even if your website returns valid content.

troubleshoot-and-fix-wordpress-404-error

The solution is simple. You will have to put the code in header.php which is located in your theme folder.

header(‘HTTP/1.1 200 OK’);

“The requested URL was not found on this server

Changing and Update WordPress Url in Database

Let’s assume you encounter the below error on your WordPress website.

“The requested URL was not found on this server. If you entered the URL manually, please check your spelling and try again.”

wordpress 404 page not showing

In such a scenario, visit your PHPMyAdmin, then locate your database name and select wp-option, e.g. blog → wp-option.

404 file or directory not found wordpress

Now change the URL like your website URL is https://www.abc.com/blog/ replace it to http://localhost/blog.

wordpress page not found but it exists

Related Read How to Backup WordPress Database Manually?

Fix WordPress 404 Not Found Error on Local Server

At the staging level, quite a few developers and designers install WordPress on their desktops and laptops by running a local server. To that effect, a general problem arises with using WordPress on a local server is that they find it difficult to get permalink rewrite rules to give desired results.

Despite fixing fix the permalinks for posts and pages, the website still shows the “404 Not Found” error.

error 404 not found - what does it mean & how to fix it

In this situation, you need to turn on the rewrite module in your WAMP, XAMPP, or MAMP installation.

Navigate to the taskbar and find the WAMP icon. After that navigate to Apache → Apache modules.

what is error 404 not found

It will enable a long list of modules that you can toggle on and off. Find the one called “rewrite_module” and click it so that it is checked.

how to fix 404 page not found error in wordpress

Then check out your permalinks again.

How to Create Your Own Error 404 Not Found Page

While you can do your best to prevent 404 errors by following the tips above, it’s impossible to entirely eliminate 404 errors because some things are just plain outside your control. It’s not uncommon for small WordPress sites to have thousands of 404 errors every month.

To provide a more user-friendly error page, you can use one of the many 404 page plugins. For example, the free 404 page plugin lets you set up a custom 404 error page with:

  • A search box
  • Important links
  • Contact information

But remember, keep your 404 page light for better performance.

Related Read – List Of WordPress Website Maintenance Tasks

Tools to Check/Monitor 404 Errors WordPress?

Adopting a foresighted approach, it’s crucial to analyze which requests are resulting in 404 errors at your site. This helps you in:

  • Find broken links that are directing visitors to a page or a site that is unavailable. Eventually, you can take all remedial steps to fix such broken links.
  • Understand which pages or pieces of content have difficulty, coming in the preview of Google crawlers. Then you can make necessary corrections primarily by setting up a redirect.
  • Troubleshoot issues and improve performance with regard to 404 errors.

Use WordPress Plugin

If you want to use a WordPress plugin, the aforementioned Redirection plugin can help you monitor for 404 errors from your WordPress dashboard.

 Use 404 error broken link checking Tools

You can also use a third-party audit tool like Ahrefs to monitor for 404 errors on your WordPress site. You can even set this up to run on a schedule.

Check every link on your website to determine whether the link leads to a 404 error using tools for checking broken links is the broken link crawl (or scan) tool.

Crawl tools:

  • Screaming Frog
  • SiteLiner,
  • SiteBulb

Use Analytics Tools

For example, you could trigger the following event onload of the error page:

ga('send', 'event', 'error', '404', location.pathname);

With the help of Google Analytics, you can set up a custom report to track 404 errors from external links.

Use Free broken link checker / dead links tools

  •  error404.atomseo  – A free web-based online tool for checking broken or dead links (404 errors)
  • Dead Link Checker: Free Broken Link Checking Tool
  • Brokenlinkcheck – Free Broken Link Checker Dead Link Checking Tool
  • chrome.google.com/webstore/detail/broken-link-checker/ –  find all broken links (404 errors) on the web page
  • Dr. Link Check: Broken Link Checker
  • Hexometer – Broken Links Scanner for 404 or Dead links

Find 404 error pages using search console google

Google Search Console is often used less. However, lastly, you can track 404 errors along with other important information about your site and its referencing is indicated there. Just go to Crawl → Crawl Errors, -Not found, to view a list of 404 errors that Google has encountered. This can also in particular help you to improve the user experience and the visibility of your website.

Find-404-pages-using-search-console-google

In most cases these solutions will fix the WordPress posts 404 error. However, if it does not work for you, then you may probably need help.


Get in touch with our team of WordPress Experts To Solve Errors on Your WordPress Site.


Other Useful Articles (In-Depth)

  • Fix This account has been suspended wordpress issue
  • How to disable directory listing in wordpress
  • WordPress hacked redirecting to another site how to clean it
  • How To Fix hacked Godaddy hosted site
  • Fix Japanese Keywords hack In WordPress Site
  • How to Remove Blackhat SEO Spam in WordPress Site?

One of the worst feelings as a website user is to click a link and be brought to a 404 error page. The 404 is one of the most harmless error codes on the internet, as it simply indicates the requested page is missing. However, it can also be one of the most frustrating and impactful to users because when the content they’re looking for disappears into a puff of smoke. Google and other search engines also hate it. Luckily, fixing the WordPress 404 error and making it so that your site UX is top-notch for both search engine crawlers and normal users is pretty straightforward.

Subscribe To Our Youtube Channel

What Exactly is a 404 Error Code?

The dreaded 404 is an HTTP response status code. It’s similar to the 503, 500, 301, and so on that you may see occasionally. They’re not all bad. For instance, a 301 response code just means that one page has permanently redirected to another. The 404 is one of the bad ones, though — the 400 and 500 blocks are the ones to watch out for the most as they’re the client and server errors respectively.

The Mozilla Developer Network MDN defines the 404 like this:

The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurrence on the web.

The important points to remember are that the URL is not recognized and that the endpoint is valid but the resource itself does not exist. We’re going to show you how to deal with these kinds of issues so that you can limit the 404s on your site to only those (hopefully) you have no control over.

When is a 404 Not Really a 404?

Well, technically a 404 is always a 404. But sometimes, a 404 pops up when there’s nothing you can do about it. That’s what the MDN is talking about above.

For instance, there’s nothing you can do about someone typing in your website’s URL incorrectly. If they are trying to reach elegantthemes.com/blog and they type in elegantthemes.com/blag, they’re going to get a 404 error. Not because our site is set up incorrectly or that anything is wrong — they just had a typo. That’s what the MDN means by the URL is not recognized.

And when the endpoint is valid but the resource itself does not exist, what happens is that the URL itself is fine. It has been typed in perfectly, the link is/was correct, but whatever it’s pointing at has moved. Maybe it was linking to a elegantthemes.com/divi-changelog.pdf, but we renamed the file to simply changelog.pdf. The user would get a 404, but they wouldn’t have done anything wrong. That would be on our end, so we could fix that with a simple 301 redirect.

Or if the person goes to elegantthemes.com/blackfriday a day before the sale starts. What greets them? A 404. Not because they’d be doing anything wrong, but because the page hasn’t gone live yet. The URL is correct, and the content exists. But because the browser can’t return it because it’s not technically on the internet yet. Again, it’s a 404, but not really.

With all that in mind, however, let’s get to the ones beyond your control and that your visitors can’t fix with a few presses of the Backspace key. Also remember that these kinds of 404 errors won’t impact SEO, generally. Because search engines will find the content that’s there and not typically enter the wrong URL.

How to Find WordPress 404 Errors

When working in WordPress and trying to find all the 404 errors that your site might have, you can start at any number of places or use any number of methods. There are, however, some pretty easy and simple ways to track them down.

Google Search Console

One of the top tools for anyone who owns a website is Google Search Console. If you’re not familiar with it, this is the time to really dig in and become friendly. From this one dashboard, you get just about as much insight into your website as you could want. If you’re familiar with how Google Analytics breaks down your metrics, the Search Console does it similarly.

For instance, to check your WordPress 404 errors, you just need to go to the Coverage tab to the left of the dashboard to see what the particular errors are.

WordPress 404 Error

You will see the number of errors and issues in general over time, as well as be able to get detailed analysis of the errors by clicking into them. The Google Search Console also provides documentation on how to deal with different issues and error codes. For instance, this is the document for fixing the soft 404 errors that are in the above picture.

Check External Links

In WordPress (and other CMS platforms, too), you can change your permalinks very easily. In WP, you just need to go into Settings – Permalinks, and you can make the URLs for your site show up in any structure you want. Any time you want. But you don’t want to change these willy-nilly. Because other sites have (likely) linked to your site already. Anyone who then clicks their link will be taken to a 404 page.

WordPress 404 Error

Giving people a redirect link or search box helps alleviate some of the pain so they can find the page they’re looking for, but you will want to make sure that’s kept to a minimum. To do so, you will want to check your External Links in Google Search Console. You will find it under Links – External Links – Top Linked Pages.

WordPress 404 Error

You can expand to see every backlink to your site by clicking More. The rest of this process is manual, though. Depending on how your URL structure has changed over time, you will want to take any individual links that have been altered. Such as ones going from example.com/post-name to example.com/author/post-name. You will want to then take the old URL and 301 redirect it using a plugin like Redirection or something similar by pasting in the old URL that gets clicked and then pasting in the new one to target.

WordPress 404 Error

Now, regardless of what external links someone clicks, they should be taken to the correct page on your site, bypassing the Error 404 Page Not Found entirely.

How to Create Your Own Error 404 Not Found Page

Fixing the Error 404 page is one thing. But no matter what steps you take to keep it from happening, someone will eventually land on the error page. And you want to be ready for that. Luckily, creating a 404 page is pretty simple.

In some cases, your theme might have a WordPress 404 error page already created. You can check this under the wp-content – themes – theme-name folder. You are looking for a file called 404.php. This lets WordPress direct the browser to a specific page rather than simply showing a default page with no content.

WordPress 404 Error

As you can see in the image above, the 404.php file is a basic file that simply displays any HTML you want visitors to see (along with PHP hooks and such, too). If you’re a hand-coder, all you have to do is write the code you want to display and save the file via FTP or your file manager. Now, any visitors who get the error will be directed here.

Please remember that any customization that you make to your theme’s 404.php will be overwritten by updates, so make sure that you do any edits in a child theme. You can find additional details on creating a 404 page in the WordPress Codex or our own detailed guide.

Creating a Custom 404 Page in Divi

If you are a Divi user, we have you covered, too. The Divi Theme Builder gives you a ton of flexibility in creating custom 404 pages.

WordPress 404 Error

Be sure to check out our detailed guide and tutorial with a downloadable template that will guide you through the whole process.

Plugins to Create a 404 Error Page

If you’re either not a Divi user or don’t want to worry about editing PHP files, never fear. The WordPress.org Plugin Repository has plenty of options for you to choose from to create your own custom Error 404 page and redirect it back to where you need it to be. We have gathered a list of some of the most popular and highest-rated options.

  • All 404 Redirect to Homepage
  • Custom 404 Pro
  • 404page – your smart custom 404 error page
  • 404 Solution
  • 404 to 301 – Redirect, Log, and Notify
  • WP 404 Auto Redirect to Similar Post

Wrapping Up

If your website returns any errors, the 404 is one of the tamest and easiest to fix. Some themes come built in with 404 pages, while others give you the tools to create your own custom ones. If you use the Google Search Console, you can find any number of soft and hard 404 errors on your site and use the plugins we’ve listed above to make sure that your SEO, page rank, and user experience don’t take a hit. And remember, one of the most important things you can do on a 404 page is to give a search box and a home-page redirect (or a series of suggested posts) so that the user doesn’t bounce from your site, but continues to use it. Good luck, and may all your 404s be soft.

What do you do to manage your HTTP error 404s?

Article featured image by Zhitkov Boris / shutterstock.com

Struggling with how to fix the 404 Not Found error on WordPress posts and pages?

This error might appear sometimes when you, or a visitor, try to access a certain page on your site. Instead of seeing the content that you expected, you see something like an “Error 404 Not Found” message instead.

Thankfully, this error message is usually localized to the specific page in question. That is, it shouldn’t affect any other parts of your site (though it can in rare cases).

However, that doesn’t mean it’s not frustrating, and you’ll definitely want to do your best to prevent and fix 404 errors on your site.

In this post, we’ll cover everything that you need to know about 404 errors including:

  • What the 404 Not Found error is and what causes it
  • Fixing sitewide 404 errors on WordPress
  • Fixing individual 404 errors on WordPress
  • Monitoring your site for 404 errors
  • Creating a custom 404 page for your site (this will make more sense after you’ve read the other sections!)

Table Of Contents

  1. What Is Error 404 Not Found?
  2. How to Fix Sitewide 404 Not Found Errors in WordPress
  3. How to Fix Individual 404 Errors on WordPress
  4. How to Monitor Your WordPress Site for 404 Errors
  5. How to Create a Custom 404 Error Page
  6. Fix the WordPress 404 Not Found Error Today

What Is Error 404 Not Found?

The Error 404 Not Found message appears when you, or one of your visitors, tries to visit a page on your site that doesn’t exist.

That could be either because the page never existed, the page was removed (deleted), or the page’s URL was changed to a different URL.

For example, let’s say you have a blog post at yoursite.com/2020-guide. If you update the post for 2021 and change the URL to yoursite.com/2021-guide, then anyone who tried to visit the original 2020-guide URL would see a 404 error because that page no longer exists at that URL (unless you set up a redirect – more on that later!).

Most of the time, the error only appears when a person tries to visit a nonexistent URL on your site. That is, the error won’t affect any content that does exist.

In rare situations, however, a corrupted .htaccess file can cause the 404 error to appear on your entire site.

404 Error Variations

The 404 Error Not Found message can appear in several different variations depending on what web hosting/web server you’re using, the browser that a visitor is using, and how your site is configured.

Here are some common variations:

  • “Error 404”
  • “404 Not Found”
  • “Not Found”
  • “Page Not Found”
  • “The requested URL was not found on this server.”
  • “HTTP Error 404”
  • “We can’t find the page you’re looking for.”
  • “The page cannot be found”

To add some further complexity, it’s actually possible to create your own custom 404 message that will appear whenever there’s a 404 error on your site.

We’ll cover this topic in more depth later on, but this lets you create a more user-friendly error message and help redirect users to the right spot.

For example, on the Astra website, we have a custom 404 page that includes a search box to help users find the content that they’re looking for:

Custom 404 error page Astra

This is actually the default 404 error page for all sites using the Astra theme, though Astra makes it easy to create your own custom design – more on that later too.

Some websites even use their 404 pages as a way to show some creativity, like this 404 page from Ready to Go Survival:

Custom 404 error page 2

Sujay Pawar

Hello! My name is Sujay and I’m CEO of Astra.

We’re on a mission to help small businesses grow online with affordable software products and the education you need to succeed.

Leave a comment below if you want to join the conversation, or click here if you would like personal help or to engage with our team privately.

What Causes Error 404 Not Found?

There are two types of 404 errors that you might be experiencing and the likely cause depends on which type of error it is.

We’ll include fixes for both types of problems below.

If you see a sitewide 404 Not Found error no matter what page you try to visit, the issue is likely with your WordPress site’s permalink structure or .htaccess file.

Something got corrupted somewhere which is causing your site’s server to think your site’s URLs don’t exist. It sounds serious, but this one is usually pretty easy to fix so don’t worry.

On the other hand, if you only see the 404 Not Found error on specific URLs (but the rest of your site works), then there are several potential problems:

  • Broken links – Someone might be linking to a page on your site that doesn’t exist. This could be an external link on someone else’s site or an internal link on your own site. When people click the link, it takes them to a page that doesn’t exist and triggers the 404 error.
  • Changed URLs – If you change the URL of a piece of content, you might have people still trying to visit the old URL which will trigger a 404 error (unless you set up a redirect).
  • Typos – Someone might have accidentally mistyped the URL that they’re trying to visit.

It’s impossible to fix all of these causes because you can’t prevent someone from making a typo.

But you can fix broken links and changed URLs, and you can create a custom 404 page to create a more user-friendly experience for users who make typos.

Why You Need to Fix Error 404 Not Found?

The 404 error can be problematic for a couple of reasons.

The biggest reason is that it’s just plain frustrating for your visitors. They’re trying to access a certain piece of content. Instead of seeing the content they expected, they’re seeing a 404 error instead.

For this reason alone, you should always try to fix 404 errors on your site.

Beyond creating a poor user experience, 404 errors can also be an indirect drag on search engine optimization (SEO). If the 404 error is a result of a broken internal or external link, you might be wasting link equity.

Basically, Google ranks a page in part on how many links point to it. So if a link points to a missing page instead of the actual URL, you’re essentially missing out on the benefit of that link.

Some SEO experts also claim that 404 errors can make it harder for Google to crawl your site, though Google says this isn’t an issue.

How to Fix Sitewide 404 Not Found Errors in WordPress

If you’re seeing the Error 404 Not Found message across your entire WordPress site, you should be able to fix the problem by regenerating your site’s .htaccess file or permalinks.

If you can still access your WordPress dashboard, you can do this directly from your dashboard. Otherwise, you might need to connect to your server using FTP.

Assuming you still have dashboard access, all you need to do is go to Settings → Permalinks in your dashboard.

Then, just click the Save Changes button.

There’s no need to make any other changes – just clicking Save Changes will force WordPress to generate a new .htaccess file, which should fix the problem:

fix sitewide 404 errors

If you can’t access your WordPress dashboard, you’ll first need to connect to your site’s server using FTP with a tool like FileZilla (tutorial here).

Then, delete the existing .htaccess file. We recommend downloading a copy of the file first so that you have a backup just in case.

Once you delete the .htaccess file, you should be able to access your WordPress dashboard and you can generate a new .htaccess file by going to Settings → Permalinks and clicking Save Changes.

How to Fix Individual 404 Errors on WordPress

If you’re experiencing 404 errors on specific pieces of content, you’ll need a more targeted approach to fix the problem.

There are two tactics that you can try:

  1. Fix any broken links on your site to make sure you’re not accidentally sending visitors to content that doesn’t exist.
  2. For remaining errors, you can set up redirects to automatically send people to the correct URL(s) instead of showing a 404 error.

How to Find and Fix Broken Links

The first step in stopping 404 errors is to make sure you don’t have any broken links on your site that send users to a 404 error.

To quickly scan your site for broken links, you can use the free Broken Link Checker plugin.

Once you install and activate the plugin, go to Tools → Broken Links to view a report.

If the plugin detects a broken link, you can fix it directly from the plugin’s interface:

broken link check

Note – while this plugin is useful, we recommend deactivating it once you’re finished to reduce any performance impact from the plugin’s scanning.

How to Set Up Redirects

For any remaining 404 errors, you can fix the problem by manually setting up a redirect to send users to the correct page.

Let’s go back to that example from before where you had a blog post published at yoursite.com/2020-guide and then you updated it for 2021 and changed the URL to yoursite.com/2021-guide.

To prevent people from seeing a 404 error when they visit yoursite.com/2020-guide, you can set up a redirect that automatically redirects the people who visit yoursite.com/2020-guide to yoursite.com/2021-guide.

There are several plugins that make it easy to set up redirects on WordPress, but we recommend the popular and free Redirection plugin.

All you do is enter the original URL and the new destination URL and the plugin will handle everything else for you:

create redirection

To learn more about what redirects are and how to use them, we have a complete guide on WordPress redirects, Or you can check this video to fix 404 errors using redirection.

How to Monitor Your WordPress Site for 404 Errors

If you want to proactively prevent 404 errors on your site, it can be useful to monitor which URLs are triggering them. Then, if you see that a particular URL is causing problems, you can step in and set up a redirect to send users to the proper spot.

There are a few ways that you can track the URLs that are triggering 404 errors:

  • Google Analytics
  • Google Search Console
  • The Redirection plugin

Google Analytics

If you’re using Google Analytics, you can use its built-in reporting to check for URLs that caused 404 errors.

To get started, go to Behavior → Site Content → All Pages and then search for “Page Not Found” with Page Title as the primary dimension:

google analytics 404

You can then click on the result to see the specific URLs that caused the error:

google analytics 404 url

In this example, you can see that yoursite.com/page-that-doesnt-exist was the URL that triggered the 404 error. You can use this information to set up a redirect.

If you’re not using Google Analytics yet, you can follow our guide to add Google Analytics to WordPress or browse the best Google Analytics plugins.

Google Search Console

Google Search Console is another useful way to track 404 errors. Unlike Google Analytics, which tracks the 404 errors that your human visitors encounter, Google Search Console will show the 404 errors that Google’s web crawler bot encounters.

Typically, these errors are the result of broken links, either on your own site or someone else’s site. Or, it could be an issue with your sitemap including content that doesn’t exist.

To look for 404 errors, go to the Coverage report and check for 404 errors in the Type column:

404 errors google search console

Redirection Plugin

For a native WordPress solution to track 404 errors, you can use the free Redirection plugin that we mentioned above. It helps you both track 404 errors and then easily set up redirects for any problems that it finds.

In the setup wizard, make sure to enable the 404 logging feature. Beyond that, there’s nothing else to configure.

You can view a log of 404 errors by going to Tools → Redirection → 404s. If you hover over an error, the plugin will give you an option to set up a redirect right away:

redirection plugin 404 error log

How to Create a Custom 404 Error Page

As we mentioned earlier, another way to lessen the impact of 404 errors is to create your own custom 404 page. You can use your custom 404 page to…

  1. Explain the error and why the visitor isn’t seeing the content that they expected to find.
  2. Include a search box.
  3. Offer some relevant links to your most popular content/features.

There are lots of different ways that you can create a custom 404 page on WordPress – we’ll share three code-free methods.

Astra Theme

If you’re using the Astra theme, you can use Astra’s built-in Custom Layouts feature, which is available in Astra Pro.

Once you activate the Custom Layouts module, you can go to Appearance → Astra Options → Custom Layouts.

Make sure to set the layout as the 404 page and then you can use the native WordPress editor or your favorite page builder to design the 404 page:

astra pro 404 page custom

For a more detailed look, you can follow our guide on how to create a custom 404 page with Astra Custom Layouts.

Elementor Pro

If you’re using Elementor Pro (our review), you can use Elementor Theme Builder to design a custom 404 page template:

Elementor 404 custom page

To learn how to use the Elementor interface, you can follow our Elementor tutorial.

404page

For a free option to create a custom 404 page, you can use the 404page plugin.

To get started, create the design that you want to use for your 404 page using a regular WordPress page (Pages → Add New). You can use the regular WordPress editor or your favorite page builder.

Once you’ve done that, go to Appearance → 404 Error Page and use the drop-down to select the page that you just created:

404page plugin WordPress

That’s it! People who experience a 404 error will now see that page.

Fix the WordPress 404 Not Found Error Today

The Error 404 Not Found message can be frustrating for WordPress users. But with the tactics in this post, you can easily fix your site’s 404 errors and prevent 404 errors in the future.

Beyond that, you can also create your own custom 404 error page that lessens the impact of errors by providing an explanation of what’s going wrong and helping visitors find the content that they’re looking for.

Do you still have any questions about the Error 404 Not Found message on WordPress? Let us know in the comments!

A common problem that most WordPress users face or will probably face at some point is WordPress page not found error. Page not found can happen as a singular 404 error when you delete an old published post or change post URL and forget to add redirection.

For example, if my link to contact page is kasareviews.com/contact but I delete that page, any link which redirects to that page will instead show your theme default 404 page.

Same will happen if I change link kasareviews.com/contact to kasareviews.com/contact-form and don’t add 301 redirect so that old links pointing to kasareviews.com/contact now redirect to correct page URL.

But in this post, I want to focus on scenario when a user can access their WordPress admin area, their blog’s main page, but when accessing a single posts or pages they get a 404 not found error.

So you know links are correct and pages and posts still exist, but for some reason, they show page not found error when visited. This usually happens if your .htaccess file got deleted or something went wrong with the rewrite rules. What you need to do is fix your permalinks settings.

Mainly those “Page Not Found” are called dead links and are generated by some reasons. Possible reasons are:

  • The page you are trying to reach does not exist
  • The visitor mistyped the URL
  • The permalink structure of the site has been changed
  • The incoming links point to pages that were moved to different locations

Improperly coded plugins, custom post types, and taxonomy alterations can break or corrupt the permalink thus causing 404s.

Sometimes a WordPress website for seemingly no reason at all delivers the dreaded 404 “page not found” error for pages and posts that actually exist.

This error is mostly prompted when you navigate from home page to other pages of your website. Usually, the 404 page not found error occurs if you mess with website settings or some other plugin modifies them.

1. ISSUE: A WordPress website shows “404 Not Found” errors on all the pages except home

#METHOD 1: RE-SAVE PERMALINKS

You can reset the permalink by going to the permalinks tab in wp-admin and simply re-saving the permalink structure.

Navigate to: WordPress Dashboard → Settings → Permalinks and click “Save Changes.”

WordPress website shows 404 Not Found errors on all pages except home

If resaving permalinks doesn’t help, try changing your permalinks structure. Choose one that you don’t use and click Save Changes. Now change your Permalinks setting back to your original configuration which was likely /%postname%/.

View your home page again and see if the Permalinks reset fixed WordPress page not found error. This will update your permalinks settings and flush rewrite rules. In most cases, this solution fixes the WordPress the requested URL was no found on this server (404 error).

#METHOD 2: UPDATE YOUR HTACCESS FILE MANUALLY

If above method doesn’t fix your issue with WordPress 404 page not found error, then you probably need to update your .htaccess file manually.

Login to your server using FTP, or using cPanel and modify the .htaccess file which is located in the same location where folders like /wp-content/ and /wp-includes/ are located. Be noted that .htaccess is a hidden file, so you must set all files as visible to be able to edit.

You can delete .htaccess file (download it before just in case) or just rename it (revert back when done) and see if the issue still persists. The .htaccess file will be automatically generated again if you delete it or rename so don’t worry.

You can also remove all code and manually add below code in your .htaccess file to revert it to default:

1

2

3

4

5

6

7

8

9

10

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

# ENDWordPress

#METHOD 3: DISABLING ALL PLUGINS

More than once I was able to solve 404 not found error on my WordPress site just by disabling all plugins. Start by deactivating plugins one by one to see if any of plugins cause the issue. Every time you deactivate plugin, just refresh your site and check if issue is gone.

If you cant access you site admin then deactivate all plugins through cPanel or using FTP by renaming plugins folder or plugin one by one.

You will find plugins folder under /wp-content/plugins. Just rename plugins folder to anything you want. Don’t forget to return it later. You can apply the same system for particular plugins.

You can also try switching your current site theme to WordPress default theme (Twenty Sixteen for example). If you cant access your site admin just rename your theme through cPanel or FTP and it will be switched to default WordPress theme automatically.

#METHOD 4: OPTIMIZING DATABASE

If you tried above methods and still seeing 404 errors, then the next step I would recommend is a database optimization. Now in this case of page not found error, this is a long shoot and for me it never solved issue. But still, you can try.

While database optimization can be done through cPanel using PHPMyAdmin I would recommend using plugin for anyone that doesn’t want to risk messing somehing or does not have acces to cPanel.

You can use plugin like WP-Optimize. Also, many security plugins and some cache plugins like WP Rocket have already integrated database optimization feature s you can utilize that.

If this method also didn’t help you solve WordPress page not found error, then I can only recommend that you contact your hosting support and see if they can help you.

2. ISSUE: WordPress website shows “404 Not Found” error because of broken link or incorrect inputted URL

This issue is usually isolated case and does not impact the whole site. It is probably case of broken link on your site. The easiest way to find those dead links is using “Google Webmaster Tools”. You can check my post how to find broken links in WordPress for more details.

If you already submitted your site to Google Webmaster tools, then you can find those dead links under Crawl Errors option.

Another way you can find dead links is by using WordPress plugin called Broken Link Checker. When you get the dead link, then just redirect the page to another page or home page. For redirection of links, I use Redirection plugin.

WordPress Page Not Found Final Words

Sometimes your WordPress website may start showing you 404 page not found errors even though the pages clearly exist. In some cases you may be able to access your home page, but nothing else. Clicking any menu item, post title or read more link gives you a dreaded 404.

Unfortunately, this happened to me more than several times. Sometimes mentioned methods will help and solve issue but often problem can be deeper.

In that case, you will need to contact your hosting support and work together with them to try and solve issue. I hope you found this guide helpful and that you were able to solve your “WordPress page not found” problem.

If you have any other method or solution to get rid of this problem please share in the comment section below. I am sure, it will be beneficial for others who are facing similar issue.


DISCLOSURE: Posts may contain affiliate links. If you buy something through one of those links, I might get a small commission, without any extra cost to you. Read more about it here.

Понравилась статья? Поделить с друзьями:
  • Error 404 page not found tilda как исправить
  • Error 404 not found обои
  • Error 404 not found мем
  • Error 404 not found картинка
  • Error 404 not found termux