"Something went wrong" clearing cache and WP error

Hello,

I’m getting the following message when trying to clear my cache.

Something went wrong

preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in style.php on line 2

This started because I have been getting the following error message on my Wordpress blog and I tried to clear the cache in the hope it might help.

Fatal error: Uncaught Error: Call to undefined function wp() in /misc/36/328/452/530/1/user/web/bretculp.bravehost.com/bret-culp-photography-blog/wp-blog-header.php:16 Stack trace: #0 /misc/36/328/452/530/1/user/web/bretculp.bravehost.com/bret-culp-photography-blog/index.php(17): require() #1 {main} thrown in /misc/36/328/452/530/1/user/web/bretculp.bravehost.com/bret-culp-photography-blog/wp-blog-header.php on line 16

My actual goal is to delete my WP blog but I can’t even get into it because of the error.

What is the proper way to fully delete a WP blog on Backlight?

Any help would be appreciated.

Thanks,
Bret

sounds like a php compatibility issue.
Is the WordPress installation up to date?

I think you can just delete all the files inside of your blog folder.
There’s a database file too, you don’t necessarily need to delete that.

Or you might be able to delete it from your hosting account

see this

Thanks, Rod. I updated from php version 8.2.x to 8.3.x and I still get the error message when I try to clear the template cache.

Also, I can’t get into WP to make sure it’s updated because of the error. If I delete the WP directory do you think it would fix the clear cache problem?

Does the WP template need to be addressed in Backlight? If I try to “re-export theme to Wordpress” I get the same template cache error. In fact, I think this is where the following error started.

preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in style.php on line 2

Regards

For some reason I no longer get the error when clearing the cache, but I still have the WP error.

That will delete the blog (assuming your blog is in the WP/ directory.

I doubt it. The “deprecated” message suggests something’s not compatible with the version of php you’re using.
If you haven’t updated the version of WordPress you’re using for a while, it could be that the php error is due to a newer version of php that isn’t compatible with the version of WordPress you have installed. You might try reverting to earlier versions of php

Is your version of Backlight up to date?

I’m on Backlight 5.4.1 and WP Theme 5.0.3. Everything should be updated and, in fact, I have reinstalled everything through the browser.

The oldest php version I can go back to is 8.0.x (Deprecate).

What about WordPress itself? Has that been updated too?

It may not have been updated in the past several months, but it shouldn’t be too behind, if at all. Unfortunately, I can’t get into WP at all to check or update due to the error.

Did you try reverting?

Yes, I tried 8.0, 8.1, 8.2, 8.3 with no change.

If your goal is still to just delete the blog, you can do that by deleting the folder that contains the WordPress files. If you installed WordPress into a folder named “blog”, delete that folder or just all the files inside of it.

But if you still need to get into WordPress, you might try posting the problem on a WordPress specific forum. Someone on one of those might have ideas of how to access an inaccessible WP admin.

Thanks for your help, Rod.

Is there a way to force Backlight to generate a new wp-config.php file? I tracked down that it was completely empty. Note that I recently changed my website domain, which is where this all started. Note that everything else on my site is working, and I changed the site and Wordpress URL in Blacklight Settings to reflect this change.

No. Backlight only creates WordPress themes.
You can download the WP files from wordpress.org and then upload a fresh wp-config.php file to the blog’s root folder

Did you also make the appropriate changes in WordPress Settings > General?

I can’t get into WP to make any changes.

I meant when you changed the domain.

Yes, I did at the time.

I would make a new Wp install in something like /blog_debug. Then you can compare files form there.

Turns out the wp-config.php somehow became blank. I generated a new one and I can now get into WP. Thanks for your help.

2 Likes