Questions tagged [errors]

Not all errors one encounters while working with WordPress are actually caused by WP. When asking about errors be as specific as possible. Just telling which error you get, is usually not enough to help you tracking it down.

Filter by
Sorted by
Tagged with
11
votes
3answers
16k views

Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()

I'm currently working on a WordPress site and whenever in the admin I go the Appearance > Menus page I get the following error: ErrorException: Runtime Notice: Declaration of Walker_Nav_Menu_Edit::...
36
votes
8answers
98k views

Cannot access non-wordpress subdirectories as wordpress overrides them with a 404 error

I refer to this question previously asked and not suitably answered: Wordpress overriding actual subdirectories and also Non "Wordpress" pages/code getting 404 error I have the same problem ...
5
votes
1answer
903 views

$wpdb->prepare() warning in WordPress 3.5

I am receiving this warning when I try to run a database query: Warning: Missing argument 2 for wpdb::prepare() The offending query is: $result = $wpdb->get_var( $wpdb->prepare( ...
28
votes
7answers
29k views

Add validation and error handling when saving custom fields?

I have a function that defines a custom field on a post type. Say the field is "subhead". When the post is saved, I want to do some validation on the input, and display an error message on the post ...
15
votes
12answers
43k views

Remove type attribute from script and style tags added by WordPress

Warning: The type attribute is unnecessary for JavaScript resources. From line 10, column 146; to line 10, column 176 feed/" /> <script type="text/javascript">window ...
19
votes
1answer
25k views

Change login error messages

took a look at the questions but I couldn`t find a similar one. I need to change the custom error messages that are displayed when user tries to login with a wrong username or password. Like, change ...
0
votes
1answer
12k views

Getting headers already sent error from plugin

I'm having a bit of trouble with a 'headers already sent' error from a Wordpress plugin I had built for me and now I'm adapting. This is the error: Warning: session_start() [function.session-start]:...
0
votes
3answers
29k views

#1115 - Unknown character set: 'utf8mb4'

When I Import Mysql from local server to web ser it is showng me error 1115 - Unknown character set: 'utf8mb4' in Creating wordpress wp_comment table CREATE TABLE IF NOT EXISTS `wp_commentmeta` ( // /...
6
votes
1answer
3k views

Validation error: Extending Gutenberg gallery block

I am trying to extend the Gutenberg core/gallery block to add some new functionality to my image gallery on the frontend. I have created a separate plugin to handle this task. I have registered my ...
4
votes
3answers
15k views

Page output in strange characters [closed]

Apparently a lot of people complain that they only see random letters and characters: My biggest problem is that I can't reproduce the problem on ANY of my devices! Not on my Windows XP laptop, not ...
21
votes
5answers
42k views

Showing errors with $wpdb update

I am using $wpdb->update to update a custom table I have in my database. When I var_dump the result it returns: int(0) So I tried $wpdb->print_error() to see what's wrong. However, it shows ...
10
votes
2answers
1k views

Is there a plugin that will override the “Error establishing a database connection” message? [closed]

My provider's database server recently had some downtime and my site was displaying the classic "Error establishing a database connection" message for about an hour. I knew what the problem was but ...
8
votes
5answers
17k views

How to eliminate weird 404 errors in wp-admin?

I run a WordPress site with about 70 active plugins. Every so often, I'll get a random error page ("Not Found", though I haven't checked the headers to see if it's a 404) on a /wp-admin/ ...
7
votes
2answers
21k views

Could not create directory /wp-content/upgrade/

When I try to automatically install updates to Wordpress or plugins, I receive an error: An error occurred while updating... Could not create directory .../wp-content/upgrade/... My web host ...
8
votes
3answers
4k views

How should one implement add_settings_error on custom menu pages?

The Professional WordPress Plugin Development book explains in detail how to properly use the Settings API, and it also demonstrates how to add Menus and Submenus, but unfortunately it doesn't provide ...
3
votes
2answers
4k views

Error 101 after upgrading Wordpress

We have just updated to WordPress 3.1.3 by following the WP manual install tutorial. Note: This is a Network-enabled (multi-site) install. After uploading the new files, we now get the following ...
0
votes
1answer
603 views

Disable Debug Log Programmatically

I'm trying to disable WP_DEBUG_LOG if and only if debug.log exists. I'd like to hook into wp_footer and test if the file exists and if so disable my debug log. All I've found though is that ...
1
vote
2answers
2k views

“Apache HTTP Service has stopped working” with WP Query in WordPress 2.9.2

When my script runs the 4th line below in WP 2.9.2, its causing my web app to throw an "Apache HTTP Service has stopped working" error $cat=get_cat_ID('top-menu'); $catHidden=get_cat_ID('hidden'); $...
0
votes
1answer
2k views

Error 310 too many redirects after switching domains

I'm at a loss here. My site is http://www.kgstiles.com and about 70% of my pages now result in a 310 error. There doesn't seem to be any pattern to the error, but one thing I thought was interesting: ...
0
votes
1answer
101 views

How do I set up Debugging?

In my wp-config.php, I have: // Enable WP_DEBUG mode define('WP_DEBUG', true); // Enable Debug logging to the /wp-content/debug.log file define('WP_DEBUG_LOG', true); // Disable display of errors ...
22
votes
5answers
50k views

wp_enqueue_script was called incorrectly

I don't know how but now I am getting this error : Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, ...
13
votes
1answer
4k views

How to disable the fatal error (WSOD) protection?

The fatal error handling was introduced in WordPress 5.1 and 5.2. It's sometimes referred to as the White Screen Of Death (WSOD) protection. When working on dev/local installs, we sometimes want to ...
9
votes
2answers
10k views

Detecting errors generated by $wpdb->get_results()

How do I detect errors when using $wpdb->get_results()? For example: $result = $wpdb->get_results("SELECT * FROM this is not a valid query"); The preceding code doesn't generate any exceptions ...
5
votes
2answers
2k views

How to use WP_Error $data argument?

The Call $error = new WP_Error( $code, $message, $data ); The Output Say I added three messages (msg A, msg B, msg C) to the code my_code and with the last message I added "Data" as $data, which ...
3
votes
3answers
5k views

Undefined property: stdClass::$labels in general-template.php post_type_archive_title()

I've got a custom post type with a standard tag taxonomy added to it like so: 'taxonomies' => array('post_tag'). I've added some tags to some posts of this CPT which are display on the front-end ...
7
votes
2answers
3k views

How to display admin error notice if settings saved succesfully?

Title sounds counter-intuitive but bear with me. :) I have options page, made with Settings API. When user enters invalid data I want to display error notice with add_settings_error() call. But! To ...
4
votes
2answers
6k views

Notice: Constant WP_POST_REVISIONS already defined

I made a local clone of a website that's running LIVE in order to safely work offline for a while. On every page of the local version I get a HUGE warning which says Notice: Constant ...
4
votes
1answer
7k views

Showing error “Function create_function() is deprecated”

we are getting a error after updating a php version to 7.2 Deprecated: Function create_function() is deprecated in /customers/3/6/9/vakantiewoning-in-zuid-frankrijk.be/httpd.www/wp-content/themes/...
1
vote
2answers
8k views

get_terms return errors

Hi when i try to get_terms(); in theme options via this code $catalogs_terms = get_terms( 'catalogs' ); $mycatalogs = array( -1 => 'Select a catalog' ); if ( $catalogs_terms ) { ...
5
votes
3answers
14k views

Strict Standards Error bootstrap navwalker

I am having trouble understanding this error and I've not come across it before, please could someone help? Strict Standards: Declaration of wp_bootstrap_navwalker::start_lvl() should be compatible ...
3
votes
4answers
12k views

Troubleshooting a “You do not have sufficient permissions to access this page” error

I have a multisite installation running WP 3.5. My main site and a few other blogs on the network work fine. However, if I register a new user and site, that user gets the "You do not have sufficient ...
3
votes
2answers
2k views

WP Cron and wp_insert_post

I'm trying to insert posts using a cron job, but I keep running into errors where WP is missing functions (is_user_logged_in, wp_get_current_user). Is there a proper way to run wp_insert_post using a ...
3
votes
1answer
1k views

Changing the Database Connection Error Message

I manage a site that got a sudden and unexpected increase in traffic. Because of that, there are database access timeouts, with the "Error Establishing Database Connection" message. This is not a ...
3
votes
1answer
414 views

Displaying oEmbed errors?

Sometimes embedding an item via oEmbed is not possible, for example when a YouTube video has embedding disabled. The oEmbed service will return a 401 Unauthorized, and the code will not be converted. ...
1
vote
1answer
116 views

Error: “Cannot modify header information”

The error that I have is a very common error. Yet I saw that the error message is different per person. The message I am getting is: array(4) { ["type"]=> int(2) ["message"]=> string(171) "Cannot ...
0
votes
1answer
14k views

Object of class WP_Error could not be converted to string

After deleting some categories (shouldn't have done this), I get the following error Catchable fatal error: Object of class WP_Error could not be converted to string in [FILENAME] on line 45 ...
-1
votes
1answer
2k views

The editor has encountered an unexpected error. // TypeError: Cannot read property 'prefix' of null

when I tried to edit a post of a custom post type, I experienced this error. When I press "Copy Error" I am getting this: TypeError: Cannot read property 'prefix' of null at https://example.com/...
10
votes
6answers
4k views

What are the best practices for updating?

Don't want to do anything to take down my blog. Here are some upgrade-related questions: How often should Wordpress be updated? What is the best way to do it? How to know if there is a problem with ...
6
votes
3answers
9k views

Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445

After changing siteurl ,home url form database it shows 3/4 errors called Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445 Notice: Undefined index: scheme ...
5
votes
4answers
33k views

Unable to locate WordPress Content directory (wp-content)

I have tried to update my plugins in wordpress-admin but for some reason i am receiving an error "Unable to locate WordPress Content directory (wp-content)" I have checked on my server and the folder ...
4
votes
3answers
9k views

$wpdb->last_error doesn't show the query on error

I am inserting data in the custom table using the $wpdb->insert. However, upon error I don't seem to get any information from $wpdb->last_error. What could be the cause of this? I already have ...
2
votes
2answers
8k views

Plugin.php: PHP Notice: Undefined offset: 0 in

I moved a WordPress site from one domain to another and there were a lot of white spaces that needed to be removed. The only problem that is left are the following errors: PHP Notice: Undefined ...
1
vote
3answers
1k views

get_the_content if it contains multiple lines it results in SyntaxError

I use get_the_content to pass to a javascript variable, and then back to another PHP function. This works great, but there is an issue when using get_the_content. If the post contains only one line (...
1
vote
0answers
899 views

Strange Deadlock database error for the query “Delete From wp_options”

I'm experiencing a strange Database error in these days, and it could the the cause of the slowness of my website (tasc.it) in these days. I found this error in the PHP error log, I can see about 4-5 ...
1
vote
1answer
33 views

Error Logs to Diagnose Error 500 in LAMP

My Wordpress site is installed in a LAMP stack (Linux, Apache, MySQL, PHP). Suppose I encounter HTTP error 500. What logs might help diagnose the issue? How can the logs be enabled? What are the ...
0
votes
1answer
37 views

Errors after upgrading PHP to 7.4 WordPress

After upgrading PHP to 7.4 FastCGI I'm getting these errors: : fread(): read of 8192 bytes failed with errno=21 Is a directory in example.com/wp/wp-includes/functions.php on line 5977 And: Warning:...
0
votes
1answer
242 views

Error messages when adding code to function.php or trying to delete inactive plugin files

Error message below: Warning: Cannot modify header information - headers already sent by (output started at /home/content/79/7603579/html/listings/wp-content/themes/OIB theme/functions.php:519) in /...
0
votes
1answer
336 views

check for the current screen

i'm working on my core theme plugin, i created a theme options in theme admin page, normally to avoid nonces errors, i must separate the sections with tabbed navigation, so i successfully did it , the ...
0
votes
0answers
176 views

Getting stripos error when trying to add menu classes

I'm using a custom theme that is doing something that blocks Custom Menu Classes (the optional ones that you can input from inside the Menu Panel) to print to HTML. I found in the code where they are ...
0
votes
0answers
825 views

http error when uploading media files

I am having this same annoying issue many other have: When I am trying to upload images into Wordpress via the media uploader, it gives me an http error. Now I have tried the following, but nothing ...