0

My wordpress them is broken and Am getting the error below.

PHP Warning: Cannot modify header information - headers already sent by (output started at /home/jcceastl/public_html/index.php:174) in /home/jcceastl/public_html/wp-includes/pluggable.php on line 1430

I've tried most troubleshooting steps but I have not been able to fix it.What could be the issue.

6
  • 1
    There's something wrong with your public_html/index.php file. The WordPress one is only 18 lines long, not 174, and does not echo out content itself. Have you deliberately changed that yourself? It should look like this.
    – Rup
    Commented Jun 1, 2023 at 10:10
  • I haven't changed it. It came with the theme
    – June Muoti
    Commented Jun 1, 2023 at 10:19
  • No, the theme file would be in public_html/wp-content/themes/your-theme/index.php. That should be WordPress's index.php.
    – Rup
    Commented Jun 1, 2023 at 10:26
  • I suggest you take a backup of everything then go through the Manual Update steps here, although it'd be safer to use the same version of WordPress as you currently have rather than the latest. Just the file replace steps - you can leave plugins etc. alone.
    – Rup
    Commented Jun 1, 2023 at 10:28
  • However it sounds like you might have unzipped your theme in the wrong place? How did you install it - manually? (That said, I'd be surprised if your theme's index.php was able to call through to wp_redirect, which is where that error is coming from, so there's something strange going on here.)
    – Rup
    Commented Jun 1, 2023 at 10:29

1 Answer 1

1

What could be the issue.

You unzipped the theme and put its files in the root WordPress folder, overwriting important files and breaking your site. Doing this will always break your site.

It only needs to happen once for it to break your site.

The website had been functioning well for almost a year.

Irrelevant. It could have been running fine for 20 years before you unzipped into the root folder. The moment you overwrote WordPress files the site broke, it doesn't matter how long it worked beforehand. Overwriting WordPress files with theme files breaks things.

How Do I Fix It?

You will need to remove the theme files that were incorrectly placed in the main WP folder /home/jcceastl/public_html/ then restore the original WordPress files using a copy of WordPress downloaded from wordpress.org.

So:

  1. Remove everything in the root folder except for wp-config.php, wp-content and .htaccess
  2. Download WordPress from wordpress.org
  3. Extract a fresh copy of WordPress into the root folder ( /home/jcceastl/public_html/ )

This will allow you to use WordPress again.

Alternatively if you made a backup beforehand, revert to that backup.

How To Update Themes Correctly

It should have been enough to upload a new copy of the theme via WP Admin. WordPress would see that it's a newer version of one you already have and update it for you.

To do it manually you replace the folder for that theme with the new version in wp-content/themes. Each theme is a subfolder containing the files for that specific theme.

Note that when you download a theme that theme/zip contains only the theme, it doesn't contain WordPress and doesn't go in the root folder.

14
  • Thanks Tom but it had been functioning well for about a year..Could it still be an issue with unzipping the theme?Plus am also getting a URL not found error when I try to access the /wp-admin files
    – June Muoti
    Commented Jun 1, 2023 at 10:46
  • did you unzip the theme into the root folder a year ago? What you're describing heavily implies you messed up installing/updating a theme by overwriting your entire WordPress install rather than just the specific folder. wp-admin giving a 404 also implies that you deleted everything beforehand, which suggests your wp-content folder is missing too. A theme folder/zip only contains a theme, it doesn't contain WordPress or any of the supporting files needed. It would be like installing a new kitchen by demolishing your entire house then building just the new kitchen and nothing else
    – Tom J Nowell
    Commented Jun 1, 2023 at 11:01
  • and yes, if you unzipped your theme into the root folder where WordPress is located then that is a big problem, and is guaranteed to cause issues and break your site
    – Tom J Nowell
    Commented Jun 1, 2023 at 11:01
  • I installed the theme from wp-admin a year ago.I have not done any unzipping on the root folder ever since. I really need help on this one.
    – June Muoti
    Commented Jun 2, 2023 at 10:17
  • it doesn't matter that it worked for the last year, you only have to unzip into the root folder once to cause this problem. My answer includes the steps you need to take to solve this, if you need additional help or a step is unclear please be specific about what it is that you need help with. Note that I can't fix this for you, and this is a question answer site rather than a help forum, so you need to ask specific questions that people can write a factual answer for that you can mark as the correct answer
    – Tom J Nowell
    Commented Jun 2, 2023 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.