I faced a surprise issue today.

I tried in different net online gate but after logging in, it gave me a permission denied error.

Though I am the administrator user of the website.

wordpress admin access denied error.

After wasting many hours, check out how I fixed this error.

Changes that I made before the error occurred?

The only thing that I did before was update a few plugins.

Article image

Plugins were Pretty Link, Spectra, and Yoast SEO.

I dont know which plugin has caused the issue.

Even I am not sure that it was caused due to the plugin update.

Article image

I tried to rename the whole plugin folder, but the error was still there.

Now one thing was sure: plugin files were not causing the error.

Actually, it was a user permission issue.

And found that wp_capabilities meta key in user_meta table was not available for the admin user.

Now the question is that who deleted this meta key?

Till now this question is unanswered.

But any way finally I found the issue and fixed it by adding this meta key in the database.

But now a new problem arose.

I was not able to get into the post editor.

It was showing me like the below screenshot.

Title and content fields are just simple text fields without any formatting or block.

I tried to kick off the post in the classic editor.

But it was also showing the source HTML editor.

TinyMCE toolbar was missing.

How I fixed the disabled block insert button issue?

Surely, it was also a user permission issue, but I was unable to find the solution.

I searched it all over the internet, but there was no clue.

I tried everything, like deactivating the plugins, reinstalling the WordPress update, etc., without any luck.

Randomly, I got the idea to check the user profile in the admin panel.

I tried to save the profile, but it gave me the error that the nick name was empty.

Then I filled in the nickname and saved it.

Surprisingly, this resolved the problem.

So, in the admin panel choose the right top corner where username and user icon is appearing.

press the edit profile menu item.

And it will bring up the user profile as like the below screenshot.

Now you’ve got the option to edit the profile.

In my case the nickname field which is a required field was empty.

I dont know how it get empty.

But anyway finally I managed to fix the issue.

I am using the WordFence plugin for security purpose.

Hopefully, anyone else facing the same issues will find this post helpful.