Title: Error validating WordPress nonce
Last modified: July 25, 2022

---

# Error validating WordPress nonce

 *  [Carlos Longarela](https://wordpress.org/support/users/carloslongarela/)
 * (@carloslongarela)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/error-validating-wordpress-nonce/)
 * Hi, today I start to receive a **Failed security check** message in several pages,
   but not in all browsers.
 * I checked the code and I see that in the file _productprint.php_ method _productprint\
   _button_ at line 462, the url is created with _wp\_nonce\_url_ that could to 
   have problems with the char & present on _$link_ var.
 * I changed that line and now all is working fine.
 * I’ll copy here the previous code commented and the new code:
 *     ```
       $link = home_url('/index.php?task=productprint&pid='.$product->get_id()); //sets the URL for the post page
       //$nonced_url = wp_nonce_url($link, $product->get_id()); // adds a nonce to the URL
       $nonced_url = $link . '&_wpnonce=' . wp_create_nonce( $product->get_id() ); // Carlos Longarela, 2022/07/25. Fix the problem with bad nonce in print page.
       ```
   
 * Kindly regards.
    -  This topic was modified 3 years, 10 months ago by [Carlos Longarela](https://wordpress.org/support/users/carloslongarela/).
    -  This topic was modified 3 years, 10 months ago by [Carlos Longarela](https://wordpress.org/support/users/carloslongarela/).
    -  This topic was modified 3 years, 10 months ago by [Carlos Longarela](https://wordpress.org/support/users/carloslongarela/).
      Reason: syntax

The topic ‘Error validating WordPress nonce’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/productprint_78bcdb.svg)
 * [WooCommerce ProductPrint](https://wordpress.org/plugins/productprint/)
 * [Support Threads](https://wordpress.org/support/plugin/productprint/)
 * [Active Topics](https://wordpress.org/support/plugin/productprint/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/productprint/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/productprint/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Carlos Longarela](https://wordpress.org/support/users/carloslongarela/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/error-validating-wordpress-nonce/)
 * Status: not resolved