Use of undefined constant NONCE_SALT

Error message

Use of undefined constant NONCE_SALT ... in Shortcode.php on line 192

Cause & solution

The problem will be related to a missing constant in your wp-config.php file. This file should contain an automatically generated NONCE_SALT constant as you see in the sample wp-config.php file at this line:

define('NONCE_SALT', 'put your unique phrase here');

In your case this seems to be missing for some reason. You should generate a new one:

https://api.wordpress.org/secret-key/1.1/salt/

connect to your FTP, and enter it into the wp-config.php file exactly where you see in the sample and that will fix the problem!

You think your wp-config.php file does contain a NONCE_SALT constant

What you should note about this issue is:

  1. Our error message is accurate, so at our code the NONCE_SALT constant really does not exists. If you do not believe us, create a plugin with this code in it, which writes out the NONCE_SALT constant's value at all your pages:

<?php

/**

* Plugin Name: Custom

**/

?>

<style>

#nonce_salt_displayer{

position:fixed;

z-index:100000;

background:white;

color:black;

top:32px;

left:0;

padding:5px;

border:1px solid black;

}

</style>

<div id="nonce_salt_displayer">

<?php

var_dump(NONCE_SALT);

?>

</div>

  1. Constants cannot be deleted or modified by any codes. If there is a NONCE_SALT constant defined in a loading PHP file, that constant will be available from anywhere, no matter what codes you have inbetween.
  2. The wp-config.php file is one of the very first files WordPress loads, as it is the base of your entire website. It runs before the codes of plugins, which makes all of its codes available for all plugins.

Based on these, your problem could be:

  1. You are editing the wrong wp-config.php file, not the one used by your website.
  2. The program you used to edit your wp-config.php file used some wrong character encoding, and there are invisible characters in your code. Try to encode your wp-config.php file differently, for example with Notepad++ program.
  3. There is a very serious problem with your website. Your WordPress core files were modified and it was done wrongly, or your server uses a messed up caching system. The developer of your website will have to debug this problem, as this issue is so severe, that someone knowing your website has to debug it.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.