Title: php Warning &#8211; Undefined array key &#8220;query&#8221;
Last modified: November 15, 2022

---

# php Warning – Undefined array key “query”

 *  Resolved [Matt Schofield](https://wordpress.org/support/users/mattschofield/)
 * (@mattschofield)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/)
 * Hi
 * Since 1.9.104, we’re getting the following php warning in our error log every
   time a visit occurs on a page containing an embedded YouTube video
 * `[15-Nov-2022 11:41:47 UTC] PHP Warning: Undefined array key "query" in /home/
   obfusc/public_html/wp-content/plugins/schema-and-structured-data-for-wp/admin_section/
   common-function.php on line 3653`
 * All pages continue to pass all markup tests without error. Thanks for looking.
 * # WordPress Configuration
    Version: 6.1 Language: en_GB
 * # Webserver Configuration
    PHP Version: 8.0.24 MySQL Version: 5.7.39 Webserver
   Info: Apache

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Magazine3](https://wordpress.org/support/users/magazine3/)
 * (@magazine3)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/#post-16203261)
 * Sorry for the inconvenience. Can you please share the URL of the site if possible?
 *  Thread Starter [Matt Schofield](https://wordpress.org/support/users/mattschofield/)
 * (@mattschofield)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/#post-16203530)
 * [@magazine3](https://wordpress.org/support/users/magazine3/) [Adult social care training](https://complete.training)
 * I didn’t think to add, but the embedded YouTube videos are on WordPress Private
   Pages (password protected) created for customers. I’m unable to provide passwords
   to those pages. The site doesn’t have any embedded YouTube videos on any publicly
   accessibly pages. Thanks, Matt
 *  Plugin Author [Magazine3](https://wordpress.org/support/users/magazine3/)
 * (@magazine3)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/#post-16205203)
 * This is the valid one. For this, We have raised the GitHub ticket in our repository.
   We will fix this and get back to you with an update soon.
 * Here is the reference GitHub link: [https://github.com/ahmedkaludi/schema-and-structured-data-for-wp/issues/1784](https://github.com/ahmedkaludi/schema-and-structured-data-for-wp/issues/1784)
 *  Plugin Author [Magazine3](https://wordpress.org/support/users/magazine3/)
 * (@magazine3)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/#post-16239229)
 * We have fixed this in our latest update 1.9.105. Can you please check once by
   updating the plugin to the latest version and let us know back if you face any
   issues? So that we will help you to fix them.
 *  Thread Starter [Matt Schofield](https://wordpress.org/support/users/mattschofield/)
 * (@mattschofield)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/#post-16243165)
 * Hi
 * Unfortunately on 1.9.105 the error is still being reported in our error log when
   visiting pages containing embedded YouTube videos. However, it now reports on
   line 3730 instead of 3653.
 * `[29-Nov-2022 07:02:17 UTC] PHP Warning: Undefined array key “query” in /home/
   obfusc/public_html/wp-content/plugins/schema-and-structured-data-for-wp/admin_section/
   common-function.php on line 3730′
 *  Plugin Author [Magazine3](https://wordpress.org/support/users/magazine3/)
 * (@magazine3)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/#post-16244562)
 * Sorry for the inconvenience. We have tested this on our end but not getting these
   errors. Can you please show us where you are getting these errors? If possible
   please share a short video to replicate the issue, So that we will test the same
   and help you to fix them.
 *  Thread Starter [Matt Schofield](https://wordpress.org/support/users/mattschofield/)
 * (@mattschofield)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/#post-16247377)
 * I’m not sure what else I can add that’s of use.
 *     ```
       # WordPress Configuration
       Version:                   6.1.1
       Language:                  en_GB
       Permalink Structure:       /%category%/%postname%/
       Memory Limit:              256M
       ```
   
 * # Webserver Configuration
    PHP Version: 8.1.12 MySQL Version: 5.7.39 Webserver
   Info: Apache
 * We’re embedding the YouTube videos within our pages using the WordPress Gutenberg
   block editor. The pages we embed videos on are all Password Protected, using 
   the native WordPress password protection. Some of the videos we embed are “Unlisted”
   on YouTube, but this doesn’t affect their URL’s. The pages that the videos are
   embedded in do not have a schema applied to them of any kind. The error notice
   I mentioned is being written to our /public_html/error_log whenever any page 
   containing embedded videos is visited. The videos don’t need to be interacted
   with to cause the error to be reported.
 * If there’s any other info you need that might be helpful please let me know. 
   Thanks again for looking.
    -  This reply was modified 3 years, 5 months ago by [Matt Schofield](https://wordpress.org/support/users/mattschofield/).
      Reason: spell
 *  Thread Starter [Matt Schofield](https://wordpress.org/support/users/mattschofield/)
 * (@mattschofield)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/#post-16260058)
 * [@magazine3](https://wordpress.org/support/users/magazine3/) This is now resolved.
   Issue detailed below
 * I discovered that one of the embeded YouTube video URL’s did not contain the 
   path /watch
 * So we had [https://youtu.be/UniQUEsTring](https://youtu.be/UniQUEsTring) (copied
   directly from the Share button on YouTube)
 * where this plugin actually needed:
 * [https://www.youtube.com/watch?v=UniQUEsTring](https://www.youtube.com/watch?v=UniQUEsTring)
   copied from the browser address bar
 * With the /watch path included, no errors are reported.
 *  Plugin Author [Magazine3](https://wordpress.org/support/users/magazine3/)
 * (@magazine3)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/#post-16261590)
 * Glad to hear the issue is resolved. If you face any other issues or having any
   queries do reach us and create a new topic.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘php Warning – Undefined array key “query”’ is closed to new replies.

 * ![](https://ps.w.org/schema-and-structured-data-for-wp/assets/icon-256x256.png?
   rev=1922284)
 * [Schema & Structured Data for WP & AMP](https://wordpress.org/plugins/schema-and-structured-data-for-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/schema-and-structured-data-for-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/schema-and-structured-data-for-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/schema-and-structured-data-for-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/schema-and-structured-data-for-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/schema-and-structured-data-for-wp/reviews/)

 * 14 replies
 * 2 participants
 * Last reply from: [Magazine3](https://wordpress.org/support/users/magazine3/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-query/#post-16261590)
 * Status: resolved