Title: Invalid authorization code or refresh token
Last modified: March 19, 2020

---

# Invalid authorization code or refresh token

 *  Resolved [Fearghal Hendron](https://wordpress.org/support/users/hendronf/)
 * (@hendronf)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/)
 * I keep getting this error. Strangely, I have a multi-site with about 9 or 10 
   sites running off it, I’ve managed to set up site kit on a number of those without
   any problems, but I’m getting the below error on this [https://brainspotting.nz](https://brainspotting.nz)
   site.
 * I’ve turned off plugins and changed themes but still running into the issue.
 * Any ideas?
 * > Unable to receive access token because of an invalid authorization code or 
   > refresh token.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Finvalid-authorization-code-or-refresh-token%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12559996)
 * [@hendronf](https://wordpress.org/support/users/hendronf/) You may be encountered
   OAuth limitations, which you can find out more about [here](https://developers.google.com/identity/protocols/oauth2#expiration).
   How many sites have you installed and activated Site Kit on?
 *  Thread Starter [Fearghal Hendron](https://wordpress.org/support/users/hendronf/)
 * (@hendronf)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12566669)
 * As a guestimate, I’d say about 5 or 6. I was hoping to set them all up with Sitekit.
   Any way to increase the limitations or browse the tokens so I can remove/delete
   some? Sorry, I’m not that experienced in identity management. Still figuring 
   it all out.
 *  Plugin Support [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12573264)
 * [@hendronf](https://wordpress.org/support/users/hendronf/) If you only have 5
   or 6 sites setup with Site Kit alone you shouldn’t encounter OAuth restrictions.
   Can you share your [Site Health information](https://i.imgur.com/Rtkmsba.png)
   and I can see if there is anything else I can see which may be contributing to
   this issue.
 *  [Renee Johnson](https://wordpress.org/support/users/reneesoffice/)
 * (@reneesoffice)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12604538)
 * [@hendronf](https://wordpress.org/support/users/hendronf/) Could you update to
   latest version 1.6.0 of the plugin and let us know if the issue persists?
 *  Thread Starter [Fearghal Hendron](https://wordpress.org/support/users/hendronf/)
 * (@hendronf)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12615246)
 * I updated and reset site kit. Managed to get as far as it giving me success message
   and allowing me to attempt to connect google analytics, then failed with the 
   same error.
 * Here is the site health info:
 *     ```
       ### wp-core ###
   
       version: 5.4
       site_language: en_US
       user_language: en_US
       timezone: +00:00
       permalink: /%year%/%monthnum%/%day%/%postname%/
       https_status: true
       user_registration: false
       default_comment_status: open
       multisite: true
       user_count: 9
       site_count: 10
       network_count: 1
       dotorg_communication: true
   
       ### wp-dropins (1) ###
   
       sunrise.php: true
   
       ### wp-active-theme ###
   
       name: Blossom Feminine (blossom-feminine)
       version: 1.3.4
       author: Blossom Themes
       author_website: https://blossomthemes.com/
       parent_theme: none
       theme_features: automatic-feed-links, title-tag, post-thumbnails, menus, html5, custom-background, customize-selective-refresh-widgets, custom-logo, custom-header, jetpack-responsive-videos, widgets
       theme_path: /home/{name}/public_html/wp-content/themes/blossom-feminine
   
       ### wp-themes-inactive (30) ###
   
       MontessoriCommons: version: 1.5, author: me
       WellTravelled: version: 0.1, author: me
       Blossom Mommy Blog: version: 1.0.7, author: Blossom Themes
       Building Blocks: version: 1.0, author: me
       Designwhore: version: 1.0, author: me
       Directoria: version: 2.1.2, author: AazzTech
       Go: version: 1.2.6, author: GoDaddy
       Gridlocked: version: 1.3, author: Orman Clark
       Launch: version: 1.0.5, author: Themely
       One Year: version: 0.1, author: me
       Paragrams: version: 1.16, author: WPSHOWER
       Redhill: version: 1.4.1, author: Automattic
       Scope: version: 1.3, author: ThemeZilla
       Smartblog Child: version: 1.0.0, author: Xalothemes Team
       SmartBlog: version: 1.0.4, author: Xalothemes Team
       Style Docs: version: 0.1, author: me
       Style: version: 0.4, author: me
       Twenty Eleven: version: 3.4, author: the WordPress team
       Twenty Fifteen: version: 2.6, author: the WordPress team
       Twenty Fourteen: version: 2.8, author: the WordPress team
       Twenty Nineteen: version: 1.5, author: the WordPress team
       Twenty Seventeen: version: 2.3, author: the WordPress team
       Twenty Sixteen: version: 2.1, author: the WordPress team
       Twenty Thirteen: version: 3.0, author: the WordPress team
       Twenty Twelve: version: 3.1, author: the WordPress team
       Twenty Twenty: version: 1.2, author: the WordPress team
       Zinc: version: 1.0.6, author: Themezilla
       Varia: version: 1.5.2, author: Automattic
       Vetee Magazine: version: 1.2, author: PressGrid Media
       Ward: version: 1.0.7, author: c.bavota
   
       ### wp-plugins-active (5) ###
   
       Akismet Anti-Spam: version: 4.1.4, author: Automattic
       Jetpack by WordPress.com: version: 8.3, author: Automattic
       PHP Compatibility Checker: version: 1.5.0, author: WP Engine
       Site Kit by Google: version: 1.6.0, author: Google
       UpdraftPlus - Backup/Restore: version: 1.16.23, author: UpdraftPlus.Com, DavidAnderson
   
       ### wp-plugins-inactive (32) ###
   
       Better WordPress Google XML Sitemaps: version: 1.4.1, author: Khang Minh
       BlossomThemes Email Newsletter: version: 2.0.9, author: blossomthemes
       BlossomThemes Toolkit: version: 2.1.6, author: blossomthemes
       Categories to Tags Converter Importer: version: 0.5, author: wordpressdotorg
       CoBlocks: version: 1.23.0, author: GoDaddy
       Contact Form 7: version: 5.1.7, author: Takayuki Miyoshi
       Directorist - Business Directory Plugin: version: 6.3.2, author: AazzTech
       Google Analytics Dashboard for WP (GADWP): version: 6.0.2, author: ExactMetrics
       MailChimp: version: 1.5.7, author: MailChimp
       MailChimp Forms by MailMunch: version: 3.1.4, author: MailMunch
       Mailchimp for WooCommerce: version: 2.3.6, author: Mailchimp
       Medium: version: 1.4.0, author: A Medium Corporation
       Meta Box: version: 5.2.7, author: MetaBox.io
       Modern Events Calendar Lite: version: 5.2.3, author: Webnus Team
       One Click Demo Import: version: 2.5.2, author: ProteusThemes
       Redux Framework: version: 3.6.18, author: Team Redux
       Search by Algolia – Instant & Relevant results: version: 2.11.3, author: Algolia
       SmartBlog Toolkit: version: 1.0.0, author: Kutethemes Team
       Vafpress Post Formats UI: version: 1.5, author: vafpress
       WooCommerce: version: 4.0.1, author: Automattic
       WooCommerce Admin: version: 1.0.3, author: WooCommerce
       WooCommerce Blocks: version: 2.5.15, author: Automattic
       WooCommerce PayPal Checkout Gateway: version: 1.6.20, author: WooCommerce
       WooCommerce Stripe Gateway: version: 4.3.2, author: WooCommerce
       WooSwipe: version: 1.1.8.6, author: Thrive Website Design
       WordPress Backup to Dropbox: version: 4.7.1, author: Michael De Wildt
       WordPress Importer: version: 0.7, author: wordpressdotorg
       WordPress MU Domain Mapping: version: 0.5.5.1, author: Donncha O Caoimh
       WPJobBoard: version: 4.1.1, author: Grzegorz Winiarski
       wpMandrill: version: 1.33, author: Mandrill
       Yoast SEO: version: 13.4.1, author: Team Yoast
       Zilla Portfolio: version: 1.0, author: Mark Southard for ThemeZilla
   
       ### wp-media ###
   
       image_editor: WP_Image_Editor_Imagick
       imagick_module_version: 1683
       imagemagick_version: ImageMagick 6.9.3-10 Q16 x86_64 2016-05-06 http://www.imagemagick.org
       imagick_limits: 
       	imagick::RESOURCETYPE_AREA: 47 GB
       	imagick::RESOURCETYPE_DISK: -1
       	imagick::RESOURCETYPE_FILE: 12288
       	imagick::RESOURCETYPE_MAP: 47 GB
       	imagick::RESOURCETYPE_MEMORY: 24 GB
       	imagick::RESOURCETYPE_THREAD: 24
       gd_version: bundled (2.1.0 compatible)
       ghostscript_version: 8.71
   
       ### wp-server ###
   
       server_architecture: Linux 4.14.94-164.ELK.el6.x86_64 x86_64
       httpd_software: Apache
       php_version: 7.1.30 64bit
       php_sapi: cgi-fcgi
       max_input_variables: 1000
       time_limit: 180
       memory_limit: 3000M
       max_input_time: -1
       upload_max_size: 1000M
       php_post_max_size: 2000M
       curl_version: 7.48.0 OpenSSL/1.0.1e
       suhosin: false
       imagick_availability: true
       htaccess_extra_rules: true
   
       ### wp-database ###
   
       extension: mysqli
       server_version: 5.6.41-84.1
       client_version: 5.5.64-MariaDB
   
       ### wp-constants ###
   
       WP_HOME: undefined
       WP_SITEURL: undefined
       WP_CONTENT_DIR: /home/{name}/public_html/wp-content
       WP_PLUGIN_DIR: /home/{name}/public_html/wp-content/plugins
       WP_MAX_MEMORY_LIMIT: 3000M
       WP_DEBUG: false
       WP_DEBUG_DISPLAY: true
       WP_DEBUG_LOG: false
       SCRIPT_DEBUG: false
       WP_CACHE: false
       CONCATENATE_SCRIPTS: undefined
       COMPRESS_SCRIPTS: undefined
       COMPRESS_CSS: undefined
       WP_LOCAL_DEV: undefined
       DB_CHARSET: utf8
       DB_COLLATE: undefined
   
       ### wp-filesystem ###
   
       wordpress: writable
       wp-content: writable
       uploads: writable
       plugins: writable
       themes: writable
   
       ### jetpack ###
   
       site_id: 170168323
       ssl_cert: No
       time_diff: undefined
       version_option: 8.3:1583633134
       old_version: 8.2.3:1582343022
       public: Public
       master_user: #1 hendronf ({email address})
       current_user: #1 hendronf ({email address})
       tokens_set: Blog User
       blog_token: 3flWHvrW^hlP(Mqr)Ok$&2oH0gduvr&!
       user_token: 6D6%eW$vRDEv*Jj2RmxJ1rW)qhoK!jvK
       version: 8.3
       jp_plugin_dir: /home/{name}/public_html/wp-content/plugins/jetpack/
       plan: free
       HTTP_HOST: brainspotting.nz
       SERVER_PORT: 443
       HTTPS: on
       REMOTE_ADDR: 122.60.192.152
       protect_header: {"trusted_header":"REMOTE_ADDR","segments":1,"reverse":false}
       full_sync: {"started":"Thu, 01 Jan 1970 00:00:00 +0000","finished":"Thu, 01 Jan 1970 00:00:00 +0000","progress":[],"config":[]}
       sync_size: undefined
       sync_lag: 0 seconds
       full_sync_size: undefined
       full_sync_lag: 0 seconds
       idc_urls: {"home":"https:\/\/brainspotting.nz","siteurl":"https:\/\/brainspotting.nz","WP_HOME":"","WP_SITEURL":""}
       idc_error_option: false
       idc_optin: false
       cxn_tests: All Pass.
   
       ### google-site-kit ###
   
       version: 1.6.0
       php_version: 7.1.30
       wp_version: 5.4
       reference_url: https://brainspotting.nz
       amp_mode: no
       site_status: connected-site
       user_status: not authenticated
       active_modules: site-verification, search-console, analytics
       required_scopes: 
       	openid: ⭕
       	https://www.googleapis.com/auth/userinfo.profile: ⭕
       	https://www.googleapis.com/auth/userinfo.email: ⭕
       	https://www.googleapis.com/auth/siteverification: ⭕
       	https://www.googleapis.com/auth/webmasters: ⭕
       	https://www.googleapis.com/auth/analytics: ⭕
       	https://www.googleapis.com/auth/analytics.readonly: ⭕
       	https://www.googleapis.com/auth/analytics.manage.users: ⭕
       	https://www.googleapis.com/auth/analytics.edit: ⭕
       search_console_property: http://brainspotting.nz/
       analytics_account_id: none
       analytics_property_id: none
       analytics_profile_id: none
       analytics_use_snippet: yes
       ```
   
    -  This reply was modified 6 years, 2 months ago by [Fearghal Hendron](https://wordpress.org/support/users/hendronf/).
 *  [Renee Johnson](https://wordpress.org/support/users/reneesoffice/)
 * (@reneesoffice)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12620725)
 * [@hendronf](https://wordpress.org/support/users/hendronf/) really appreciate 
   the details. What I’m seeing in the Site Kit section of your Site Health information
   is that the plugin is seeing your Search Console property as `http://` instead
   of the correct `https://`
 * 1) For the Google account you’re using with Site Kit, how is the site listed 
   in your Search Console and Analytics accounts respectively?
 * Was the property verified in Search Console before using Site Kit?
 * 2) There is a workaround that has helped solve setup issues for a few users that
   can perhaps can work for your case:
 * — Remove Site Kit’s access to the site here [https://myaccount.google.com/permissions](https://myaccount.google.com/permissions)
 * — Then [Reset Site Kit](https://i.imgur.com/slHxBGO.png) and attempt the setup
   process and service connections again.
 * Could you try this and let us know if it resolves the error?
 *  Thread Starter [Fearghal Hendron](https://wordpress.org/support/users/hendronf/)
 * (@hendronf)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12625963)
 * Hi Renee, Thanks for your help so far.
 * Unfortunately, those instructions seem to have made matters worse. After I Removed
   SiteKits access under the permissions tab, I realised I had to activate it everywhere
   again. Unfortunately, every time I try, I get the same error and none of my sites
   is connected.
 * Any other ideas?
 *  [Renee Johnson](https://wordpress.org/support/users/reneesoffice/)
 * (@reneesoffice)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12627330)
 * [@hendronf](https://wordpress.org/support/users/hendronf/) thanks for these details
   and I’m sorry to hear about the issues. We may need to confer with the team about
   your particular case. If you could provide these details that would be most helpful
   to get more context:
 * 1) In the permissions link, did you remove Site Kit’s access to just the site
   [https://brainspotting.nz](https://brainspotting.nz) or was that option available?
 * 2) Could you provide details on the below inquiries:
 * > For the Google account you’re using with Site Kit, how is the site listed in
   > your Search Console and Analytics accounts respectively?
   > Was the property verified in Search Console before using Site Kit?
 * 3) I notice you have both Google Analytics Dashboard for WP and Updraft Plus 
   plugins on this site.
 * Could you confirm if you are also using these plugins on your other sub-sites
   and had to provide permissions for them with your Google Account?
 * 4) Lastly, could you reset, remove, and reinstall Site Kit on this site and confirm
   if the error persists?
 * Thanks for your patience as we work to get this resolved for you.
 *  Thread Starter [Fearghal Hendron](https://wordpress.org/support/users/hendronf/)
 * (@hendronf)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12643727)
 * Hi, So things have improved quite a lot.
 * For clarity, these are not individual sites, but part of a WordPress multisite
   environment. The Sitekit plugin is not activated across the network but activated
   as individual plugins per site.
 * I’m now only stuck in the following two scenarios:
    * My root domain for my multisite(
   www.fearghal.co.uk) won’t connect to site kit at all. * I have three sites that
   connect to SiteKit, Search Console and PageSpeed Insights but will not connect
   to Google Analytics at all. Those sites are: ** [http://www.brainspotting.nz](http://www.brainspotting.nz)**
   [http://www.couplestherapy.nz](http://www.couplestherapy.nz) ** [http://www.familytherapy.nz](http://www.familytherapy.nz)
 * To answer your questions [@reneesoffice](https://wordpress.org/support/users/reneesoffice/)
   
   1) The permissions link was Sitekit access to my Google account, so it removed
   everyhting. I did remove access to everything by doing that and had to reauthorise
   everything. It wasn’t an option to remove only the branspotting site.
 * 2) Brainspotting is listed in Search Console both as [https://www.brainspotting.nz](https://www.brainspotting.nz)
   and [http://www.brainspotting.nz](http://www.brainspotting.nz) (with and without
   the s. Without the s has no data.) I deleted the http version and it reappeared
   later. In GA it’s listed as [https://www.brainspotting.nz](https://www.brainspotting.nz).
   Maybe something there?
 * 3) GA Dashboard for WP – I’m using this but want to replace it with Sitekit. 
   I’ve been activating Sitekit on the other sites then deleting GA Dashboard for
   WP without any issues. I simply had to provide the GA-* tracking code ID (If 
   I remember correctly). Updraft Plus has nothing to do with google analytics that
   backups the site(s) and syncs to dropbox.
 * 4) I’ve reset, remove and reinstalled Sitekit a few times, no difference. I’ve
   also updated to version 1.6.0.
 * Thanks so much for taking the time to problem-solve this with me. It’s in a much
   better state than before.
 *  Plugin Support [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12644378)
 * [@hendronf](https://wordpress.org/support/users/hendronf/) Many thanks for your
   thorough update, good to see there is some progress. For your main site (fearghal.
   co.uk) after checking your REST endpoints it looks like you may have differing
   URLs listed (one with http, the other with https). Please apply the same steps
   as per [this support topic](https://wordpress.org/support/topic/problem-connexion/)
   and let me know if that resolves that sites setup issues.
 * In relation to the Analytics issues can you provide an updated copy of your Site
   Health info now that those sites are connected?
 *  Plugin Support [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12678406)
 * [@hendronf](https://wordpress.org/support/users/hendronf/) Just following up 
   with you to check whether the same issues occur for you on the sites mentioned?
   If so can you share an updated copy of your Site Health information for one of
   the sites which won’t connect to your Analytics account.
 *  [Renee Johnson](https://wordpress.org/support/users/reneesoffice/)
 * (@reneesoffice)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12728088)
 * [@hendronf](https://wordpress.org/support/users/hendronf/) If I’m not mistaken,
   it appears you have been able to successfully configure Site Kit on all domains
   referenced in this topic. That’s great if so. Since we have not heard from you,
   I will close your topic. Feel free to [open a new topic](https://wordpress.org/support/plugin/google-site-kit/#new-post)
   if you should need more assistance.
 *  Thread Starter [Fearghal Hendron](https://wordpress.org/support/users/hendronf/)
 * (@hendronf)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12728102)
 * Yes. So sorry for the lack of reply. I managed to get up and running with v1.7.
   Thanks to you all for helping figure this out.
 * Best, Fearghal

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

The topic ‘Invalid authorization code or refresh token’ is closed to new replies.

 * ![](https://ps.w.org/google-site-kit/assets/icon-256x256.png?rev=3141863)
 * [Site Kit by Google - Analytics, Search Console, AdSense, Speed](https://wordpress.org/plugins/google-site-kit/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-site-kit/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-site-kit/)
 * [Active Topics](https://wordpress.org/support/plugin/google-site-kit/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-site-kit/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-site-kit/reviews/)

 * 13 replies
 * 3 participants
 * Last reply from: [Fearghal Hendron](https://wordpress.org/support/users/hendronf/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/invalid-authorization-code-or-refresh-token/#post-12728102)
 * Status: resolved