Invalid request, please go back and try again. Error Code:invalid_client Error Message: Unknown client_id.

Warning: This post has instructions that involve manipulating the WordPress database. This can break your site or result in data loss if not done properly. Take this actions at your own risk. Please back up your database before attempting this.

I received this error when attempting to activate the Jetpack WordPress plugin through the WordPress admin interface on a site I manage.

Invalid request, please go back and try again.

I don’t know exactly how I got the WordPress installation into this state. But I suspect its because I performed the following actions in the following order:

Solution Overview

The resolve this error you must do the following:

Solution Details

Backup your database

Backing up your database is outside the scope of this post. There are many ways to backup a WordPress site or database. If you run a WordPress site you should ideally have regular backups running already.

Deactivate and delete Jetpack

The next two steps are fairly straight forward. Through the WordPress admin interface, deactivate and delete the plugin.

Remove Jetpack rows from the wp_options table

This is where things get a little more tricky. I provide two options to do this. The first is using PhpMyAdmin. PhPMyAdmin is a web based tool for working with SQL databases. If you are running WordPress on your own VPS or dedicated server you probably have this installed. If not the second option will show you how to use SQL statements via the MySQL CLI.

Remove Jetpack rows using PhpMyAdmin

Log into your PhPMyAdmin web interface. On my server its installed at https://servername.com/PhpMyAdmin.

On the left hand side pane, find the database for your WordPress site. Expand the database to see the list of tables and click on the wp_options table. This will show you a paginated view of the rows in that table.

Next click on the SQL button to run a SQL query. Paste the following SQL statement in the box:

SELECT * FROM `wp_options` WHERE `option_name` LIKE '%jetpack_%'

This query will return all rows that have “jetpack” in the option name.

SELECT all jetpack rows from wp_options

Next, click the show all check box. Then finally click the delete button at the bottom of the query. This will delete all of these rows.

Finally re-install Jetpack via the admin interface and re-activate it.

Remove Jetpack rows using MYSQL CLI

Typically you will be running the MySQL CLI from the server itself. So login to the server via SSH or whatever means you have. Next start the MySQL CLI and use the database you are working on. Substitute “username” for your MySQL username and enter the password when prompted. Then run the “use” command to switch to your database, substituting “databasename” for your WordPress database name.

mysql -u username -p
mysql>use databasename;

Next we are going to run a query that does two things:

We are using sub-select or sub-query to do this. The code is as follows:

DELETE FROM wp_options WHERE id IN (
    SELECT * FROM (
        SELECT id FROM `wp_options` WHERE `option_name` LIKE '%jetpack_%'
    ) AS p
)

Now re-install and reactivate Jetpack.

Feedback?

Do you have feedback on how we can make this post better? Please leave a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.