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
18 votes
3 answers
29k 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::...
Luke's user avatar
  • 581
43 votes
8 answers
110k 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 ...
Nicole's user avatar
  • 431
5 votes
1 answer
966 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( ...
Emerson Maningo's user avatar
21 votes
1 answer
34k 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 ...
Vitor Argos's user avatar
31 votes
7 answers
37k 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 ...
MathSmath's user avatar
  • 5,578
21 votes
12 answers
61k 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 ...
WordCent's user avatar
  • 1,867
0 votes
3 answers
30k 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` ( // /...
user3728660's user avatar
0 votes
1 answer
15k 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]:...
Osu's user avatar
  • 1,442
7 votes
2 answers
6k 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 ...
Andreas's user avatar
  • 331
5 votes
3 answers
15k 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 ...
Ghazanfar Mir's user avatar
3 votes
3 answers
18k views

strange characters in wordpress website displayed for visitors [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 ...
japanworm's user avatar
  • 567
33 votes
7 answers
82k 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, ...
raiden's user avatar
  • 339
27 votes
5 answers
52k 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 ...
Jarred's user avatar
  • 498
10 votes
2 answers
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 ...
BigglesZX's user avatar
  • 103
9 votes
3 answers
5k 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 ...
jnthnclrk's user avatar
  • 1,825
8 votes
5 answers
20k 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/ ...
dgw's user avatar
  • 359
7 votes
2 answers
25k 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 ...
Steve's user avatar
  • 1,707
5 votes
1 answer
1k views

Showing WP_Error message with admin_notice action hook

I have just get an answer to one of my question but the problem is I want to print an error when every user will insert tags of more than two words through post-new.php with admin_notice action hook. ...
mha's user avatar
  • 305
3 votes
2 answers
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 ...
Alex's user avatar
  • 161
1 vote
2 answers
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'); $...
Scott B's user avatar
  • 5,666
0 votes
1 answer
128 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 ...
Murgittroyd's user avatar
0 votes
1 answer
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: ...
Christian Ostmo's user avatar
0 votes
1 answer
950 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 ...
Howdy_McGee's user avatar
  • 20.6k
21 votes
3 answers
39k views

How to catch/what to do with a WP Error Object

I am running some of the WP functions directly inside a plugin, including wp_insert_post(), if something goes wrong, this returns a WP Error object, what is the correct method to catch this error? ...
Dunhamzzz's user avatar
  • 685
15 votes
1 answer
107k views

Why $wpdb->show_errors() and print_error() is showing an output even if the query output is correct?

In order of figuring out the following issue, see https://wordpress.stackexchange.com/questions/178995/sanitize-a-working-query-string-by-using-wpdb-prepare-fails-with-mysql-db-er i ran into an rather ...
rkoller's user avatar
  • 634
14 votes
2 answers
16k 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 ...
rinogo's user avatar
  • 1,441
14 votes
6 answers
49k views

No Error Log File, no debug info

My error when writing a plugin for uploads and yes, I can debug. But it just jumps directly from this line to destruct the end of my wp-config.php EDIT: // Enable WP_DEBUG mode define('WP_DEBUG', ...
Toskan's user avatar
  • 514
14 votes
2 answers
28k views

Get error messages when $wpdb->insert() returns false?

$wpdb->insert() returns false which I've learned means that the insert failed. Now, I would like to know why it fails with the insert. According to this ticket https://core.trac.wordpress.org/...
Peter Westerlund's user avatar
11 votes
5 answers
124k views

Error: call_user_func_array() expects parameter 1 to be a valid callback

I have issue after upgrading my wordpress to 3.6 see below for errors which displays on wordpress admin panel not on front of website. Warning: call_user_func_array() expects parameter 1 to be a ...
Sufalamdev's user avatar
10 votes
6 answers
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 ...
B Seven's user avatar
  • 281
8 votes
5 answers
41k 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 ...
T2T's user avatar
  • 81
7 votes
3 answers
22k views

Displaying PHP Errors from admin-ajax.php

We've got some custom endpoints set up that do various things, which we access via /wp/wp-admin/admin-ajax.php?action=some_action However whenever there is an error as we're developing, such as ...
owenmelbz's user avatar
  • 171
7 votes
3 answers
15k 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 ...
Mehedi_Sharif's user avatar
7 votes
2 answers
4k 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 ...
Rarst's user avatar
  • 99.7k
6 votes
2 answers
11k 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 ...
RubenGeert's user avatar
6 votes
5 answers
13k 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 ...
cpilko's user avatar
  • 715
5 votes
3 answers
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 ...
Chris's user avatar
  • 87
5 votes
2 answers
3k 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 ...
kaiser's user avatar
  • 50.6k
4 votes
1 answer
15k views

How to log plugin errors to plugin error_log file

How can errors, specific to a given plugin, be logged to an error_log file contained within the plugin root folder itself? Examples: Syntax errors Database errors Compatibility errors PHP fatal ...
UncaughtTypeError's user avatar
4 votes
1 answer
2k 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 ...
Rick Hellewell's user avatar
4 votes
2 answers
15k views

Fatal error: Call to undefined function post_exists()

I am using the function in my own class as I am using other wordpress functions in it. I am unable to understand why it is not able to find the function while ide "go to declaration" point me to file ...
justnajm's user avatar
  • 143
4 votes
8 answers
67k views

How do I fix the "sorry, you are not allowed to access this page" error I get on the "plugins > settings" links?

I just upgraded to WordPress 4.6, and now when I try to click on the Settings link on some of my plugins I get this "Sorry, you are not allowed to access this page." message. I can active/deactivate ...
olimits7's user avatar
  • 143
4 votes
1 answer
15k 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/...
Devloper First's user avatar
3 votes
4 answers
21k views

How to fix ob_end_flush() error?

At the bottom of my WP-admin pages I get this: ob_end_flush(): failed to send buffer of zlib output compression (1) in C:\Users\anticaking\Desktop\Website\wordpress\wp-includes\functions.php on line ...
lurning too koad's user avatar
3 votes
1 answer
499 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. ...
Jan Fabry's user avatar
  • 30.4k
3 votes
2 answers
12k views

How to show an error message after publishing a post?

I'm using the transition_post_status hook to perform some operations after publishing a post. In some conditions I would like to show an error message in a red box under "Edit Post" and above "Post ...
User's user avatar
  • 341
3 votes
2 answers
30k views

PHP Deprecated: Non-static method should not be called statically

My debug.log has the following message that points to /wp-includes/shortcodes.php on line 319, which is part of WordPress core and probably isn't where the real error is in the code. PHP Deprecated: ...
Cynthia A Lockley's user avatar
3 votes
2 answers
3k 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 ...
nathanaelphilip's user avatar
3 votes
3 answers
6k 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 ...
ivvi's user avatar
  • 649
2 votes
3 answers
1k views

Settings API - Undefined Index when unchecking checkbox

I know this may be a duplicate however I haven't been able to make sense of previous questions. I have a checkbox on a settings page. Everything is okay on the first load of the page, if I check the ...
Ben H's user avatar
  • 363