Title: Fixing undefined key array error from wp_verify_nonce in WP-CLI
Last modified: July 23, 2026

---

# Fixing undefined key array error from wp_verify_nonce in WP-CLI

 *  [Ken Gagne](https://wordpress.org/support/users/kgagne/)
 * (@kgagne)
 * [2 weeks, 3 days ago](https://wordpress.org/support/topic/fixing-undefined-key-array-error-from-wp_verify_nonce-in-wp-cli/)
 * I was using WP_CLI to update a bunch of posts unrelated to my site’s podcast 
   when I continuously received this warning:
 *     ```wp-block-code
       Warning: Undefined array key "wsl-sab-nonce" in /srv/htdocs/wp-content/plugins/smart-app-banner/wsl-smart-app-banner.php on line 544
       ```
   
 * It came from line `544` in`wsl-smart-app-banner.php`:
 *     ```wp-block-code
       if ( ! wp_verify_nonce( $_POST['wsl-sab-nonce'], plugin_basename( __FILE__ ) ) ) {
       ```
   
 * I changed it to this, and the error went away:
 *     ```wp-block-code
       if ( ! isset( $_POST['wsl-sab-nonce'] ) || ! wp_verify_nonce( $_POST['wsl-sab-nonce'], plugin_basename( __FILE__ ) ) ) {
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [stephend](https://wordpress.org/support/users/stephend/)
 * (@stephend)
 * [2 weeks ago](https://wordpress.org/support/topic/fixing-undefined-key-array-error-from-wp_verify_nonce-in-wp-cli/#post-18975468)
 * Thanks for your feedback. Yes, it looks like a bug and your fix appears to be
   sensible. (Actually, there’s _a_ fix for it in the master branch… but now that
   I look at it, I realise that it’s not correct.)
 * I’ll try to update the plugin when I get the chance. Unless you have set PHP 
   to treat warnings as errors, it’s benign.

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffixing-undefined-key-array-error-from-wp_verify_nonce-in-wp-cli%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://s.w.org/plugins/geopattern-icon/smart-app-banner_afbcc7.svg)
 * [Smart App Banner](https://wordpress.org/plugins/smart-app-banner/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/smart-app-banner/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/smart-app-banner/)
 * [Active Topics](https://wordpress.org/support/plugin/smart-app-banner/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/smart-app-banner/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/smart-app-banner/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [stephend](https://wordpress.org/support/users/stephend/)
 * Last activity: [2 weeks ago](https://wordpress.org/support/topic/fixing-undefined-key-array-error-from-wp_verify_nonce-in-wp-cli/#post-18975468)
 * Status: not a support question