Title: PHP Notice:  Undefined variable: random_author_query
Last modified: September 1, 2016

---

# PHP Notice: Undefined variable: random_author_query

 *  Resolved [Will Woodward](https://wordpress.org/support/users/willjw/)
 * (@willjw)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/php-notice-undefined-variable-random_author_query/)
 * Error location: `jetpack/modules/theme-tools/random-redirect.php` on line 66.
 * Solution: replace the following:
 *     ```
       // Set author name if we're on an author archive.
       if ( is_author() ) {
           $random_author_name = get_the_author_meta( 'user_login' );
           $random_author_query = 'AND user_login = "' . $random_author_name . '"';
       }
       ```
   
 * with:
 *     ```
       // Set author name if we're on an author archive.
       if ( is_author() ) {
           $random_author_name = get_the_author_meta( 'user_login' );
           $random_author_query = 'AND user_login = "' . $random_author_name . '"';
       } else {
           $random_author_query = '';
       }
       ```
   
 * [https://wordpress.org/plugins/jetpack/](https://wordpress.org/plugins/jetpack/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * (@jeherve)
 * Jetpack Mechanic 🚀
 * [9 years, 10 months ago](https://wordpress.org/support/topic/php-notice-undefined-variable-random_author_query/#post-7611168)
 * Thanks for the report! We’ll work on getting this fixed. You can follow our progress
   here:
    [https://github.com/Automattic/jetpack/pull/4584](https://github.com/Automattic/jetpack/pull/4584)

Viewing 1 replies (of 1 total)

The topic ‘PHP Notice: Undefined variable: random_author_query’ is closed to new
replies.

 * ![](https://ps.w.org/jetpack/assets/icon.svg?rev=2819237)
 * [Jetpack - WP Security, Backup, Speed, & Growth](https://wordpress.org/plugins/jetpack/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jetpack/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jetpack/)
 * [Active Topics](https://wordpress.org/support/plugin/jetpack/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jetpack/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jetpack/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jeremy Herve](https://wordpress.org/support/users/jeherve/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/php-notice-undefined-variable-random_author_query/#post-7611168)
 * Status: resolved