I am redirected to my site homepage when I login using mysite/wp-admin instead of getting to the wordpress admin page - wordpress

I am getting redirected to my website homepage when I login to the admin area in Wordpress or I get an error message saying 'Sorry, you are not allowed to access this page'
I just migrated my website from one host provider to another using the All in One WP migration plugin. I was able to access the admin area but once the backup, I am either being redirected to my homepage or getting the above error when I try to login. I have already tried to create a new user with admin privileges, modified the wp-config and htaccess files and even updating and changing the prefixes of the database. I have also tried disabling the plugin and theme files and none of them seem to work.
I just want to be able to login to the admin area of my WordPress site.

In such cases the steps I follow to resolve this case are:
Set .htaccess with only the default WordPress redirect rules, which you can check here.
Set the default TwentyNineteen theme as active. Since you do not have access to your admin dashboard you can perform this change by altering the "template" and "stylesheet" rows in your application database which both are located in the "_options" table.
The other option is via SSH. From the WordPress root directory you can execute the following command, which will change the currently active theme to TwentyNineteen:
wp theme activate twentynineteen
NOTE: No matter which option you choose the TwentyNineteen theme should be installed. If you have other WordPress default theme installed rather than TwentyNineteen, you can switch to it.
Deactivate all of the plugins. This can also be performed in two ways without access to the admin dashboard. The first option is to rename the wp-content/plugins folder to:
wp-content/plugins-backup
The other option is once again via the WP CLI tool with the next command:
wp plugin deactivate --all
Another NOTE: In order to use the WP CLI tool, please note that the same should be installed on the server. If you write the command and the terminal respond is:
-bash: wp: command not found
Or something similar ending with "command not found" this means that the tool in question is not installed. In this case you will be unable to use the WP CLI tool or you can ask your hosting provider to install this tool for you.
In my experience with this issue, after all of these changes are performed the access to the admin dashboard is restored. If the issue still persist even after the changes are applied, I would recommend you to contact your current host provider in order to understand if they have any custom Web Application Firewall (WAF) rules, default plugins/optimizations that could cause such issue.

Related

Uninstall WPS Hide Login

I was working on a project (just for fun) some weeks ago and Ive installed the WPS Hide Login for security purposes. Unfortunately, Ive forgot the admin address and I would like to know how to uninstall this plugin without accessing the control panel (with I do not have access).
It`s possible to do only accessing the phpMyadmin?
Either go to your MySQL database and look for the value of rwl_page in the options table, or remove the rename-wp-login folder from your plugins folder, log in through wp-login.php and reinstall the plugin.
From the project git page

My wordpress site is brocken. dont know what todo. Tried safe mode plugin but nothing happen

My wordpress site was working fine , but wordpress update it to V 5.4 and after that my website is not working , not even i can access my admin dashboard.
I tried all these step to solve this
MANUAL INSTLLATION (RECOMMENDED)
Download the WP Safe Mode plugin and unzip it, you’ll now have a
wp-safe-mode folder.
Connect to your server (for example via FTP) and go to your website
folder.
Add this line to your wp-config.php file:
if( !defined('WPMU_PLUGIN_DIR') ) define( 'WPMU_PLUGIN_DIR',
dirname(__FILE__).'/wp-content/wp-safe-mode' ); //WP Safe Mode
Create the folder named wp-safe-mode inside your wp-contents folder.
Uploade the file wp-safe-mode/bootstrap/wp-safe-mode-loader.php into
the newly created wp-safe-mode folder.
Upload the entire wp-safe-mode folder to your plugins folder in
wp-content/plugins.
If your site is broken and you cannot install plugins or access the dashboard, you can modify the loader file temporarily to gain access by following these additional steps:
Open the plugin file wp-safe-mode-loader.php and change this line:
public $safe_mode_on = false;
to
public $safe_mode_on = true;
Upload the modified wp-safe-mode-loader.php file to the
wp-contents/plugins/wp-safe-mode folder.
Visit your site, deactivate plugins etc.
Undo the changes you just made to wp-safe-mode-loader.php when you
want to disable safe mode.
But nothing works for me. Can you please suggest something so i can fix my problem
Theme Conflict Troubleshoot:
To perform this, you just activate a default theme, like Twenty Nineteen. Unfortunately, because your site is showing an error, you will need to perform the troubleshoot with either your web host’s file manager (like cPanel’s Filemanager), or use FTP or sFTP (it’s like secure version of FTP.) It’s important to note that in switching themes, you won’t lose your chosen theme’s settings. To do this, you rename your active theme’s folder by adding DISABLE or OFF to the end of the folder’s name. For example, if you’re using Twenty Eighteen and the folder is ‘twentyeighteen’, you would name it ‘twentyeighteenDISABLE’ or ‘twentyeighteenOLD’ . Go back to the front of your site and refresh.
The objective is to check whether the mistake leaves. In the event that it doesn’t, it is anything but a subject issue. Try to rename the organizer back to its unique name when you’re finished investigating.
Plugin Conflict Troubleshoot
If it’s not the theme, it might be a plugin issue. In a way, troubleshooting is similar. However, it’s much easier to rename the plugin folder to ‘pluginsOFF’. Visit the site, and log-in. This will turn off all of the plugins. Please note that it won’t remove the original settings of those plugins, as they will be there when you reactivate them later on.
Once the plugins are off, go back and rename the folder back to ‘plugins’. Go to your WordPress admin area and reactivate each, one-by-one, until you get the screen that says “There has been a critical error on your website”. The plugin that you just reactivated, is the problem.
You can either disable the plugin that caused the problem or remove it or roll it back to the previous version using the rollback plugin and wait until the developer releases a new version of the plugin.

Wordpress 5.0.3 - "Updating failed" and "Publishing failed". Console log shows a 404 on /blog/wp-json/wp/v2/posts/1177/autosaves?_locale=user

I updated Wordpress to the latest version (5.0.3). Now, any time I try to post I get a red message that says "Publishing failed". If I try to save a draft I get "Updating failed".
In console, I'm seeing
https://mydomain/com/blog/wp-json/wp/v2/posts/1177/autosaves?_locale=user 404
When I test the URL with /wp-json/wp/v2/posts/ I get a 404. If i use ?rest_route=/wp/v2/posts/ instead, I get my blog. I'm using Post name for permalinks.
Is there a way I can change the WordPress editor to use the rest route that is working? Or can I change something in my Nginx config?
two easy solutions:
You should deactivate the security plugin, in my case problem was with Advanced Access Manager plugin that I deactivate it and problem fixed.
Use the Classic Editor plugin By WordPress Contributors, just install this plugin and use the Classic editor, here is the setting that you can use both classic and block editor.
Setting->Writing->Allow users to switch editors
then in the create page, you have this option
For block editor => Switch to Classic Editor
And Classic editor => Switch to Block Editor
I changed my Permalink to Plain, then it's working, else it's throwing the same error!
I guess this has something to do with permalinks and how url is rewritten. once I change my permalinks option to plain everything seems fine. I'm using a local install with nginx. hopefully will find out why this happens later.
I had a similar problem with WordPress 5.2.2. I couldn't save or publish a page (new or old). Although all requests in the page editor return 200 I realized that some requests had a request domain of my site and others a request domain of the hosting company. So, I went to Settings > General and changed the settings Site Address (URL) and WordPress Address (URL) to be the same value (I copied the value of Site Address (URL) into WordPress Address (URL)) and that fixed the problem with the editor.
Step 1: Open the WordPress and login as administrator. When you post new content or older content you will be getting error message.
Step 2: So, now choose the older version of Editor of WordPress instead to use new version. To choose older version go to settings and then click on writings. Here you can find option "Classic Editor" and if you will not find option then choose second option.
This is one option but if you are not fixed with this option choose second option such as
Open the WordPress and on the left side you have list of tasks to be performed in WordPress. Click on the option “Plugin” and you will be opened with the plugin screen. On the top of the screen, you have the button “add new”.
Step 3: After clicking on the add new button, new screen will be opened. There, you can see classic editor plugin. Kindly, download and install it. Once it is installed, then activate it by clicking on the “activate” button.
Step 4: Again, go the Settings option and click on the Writing. In the Writing section, you have many options such as formatting, default post category, default post format, default editor for all users, allow users to switch editors, post via email etc.
Click on the classic editor choice in default editor for all users. This makes you to work easy on content posting newly or updating the previous contents.
With wp cli:
wp core update (get the latest version)
wp plugin update --all (why not update plug ins too)
wp plugin install classic-editor (get this)
wp plugin activate classic-editor (activate)
When we get 404 in wordpress pages and publishing failed there could be an issue with .htaccess file.
Update your Permalink settings and check .htaccess file, If .htaccess file is exist, and it's correct, confirm in your server .conf file have
Or your .htaccess file is not able to override server configuration
<Directory /var/www/web-app-wordpress>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
Restart apache server after updating this code.

WordPress website pages are redirecting to adult site pages

I have a website built on WordPress platform. Today, when I opened the website and when I clicked anywhere on the website, adult site pages are opening up continuously.
Can anyone please suggest what could be done to resolve the issue?
Your site is hacked by someone and some script injected in your WordPress installation or database which causing to load this video your website need to scan your website using plugin like SECURI You can get this on Securi.net
Here are some solutions that you can try(Remember to take a backup before using this)
Check and clean all your recently modified files
Contact your hosting provider if you are not using dedicated server.
If you have some inactive themes and plugins which you don't need more remove them.Hackers can hide script there.
-You can upload new word-press core files which you haven't customised.
Install fresh copy of themes and plugins if you not customised them.
Change your secret keys in your wp-config file.
Check users in your word-press and delete suspected ones.
Check permission of your installation directory .if not secure them make changes.
Change you WordPress password
If this all not works to solve problem let me i will look into it.

Plugin edit made Wordpress.org admin panel broken

So I went and edited a plugin called Huge IT portfolio and added an echo "1"; exit(); in it and now i can't access the admin panel (yet i can access the site) it just gives me the echo 1.
What can I do to revert the changes to it? I can't even paste the code anymore since i can't access it
If you can access the admin panel anymore you have a few options, they all involve accessing the website via FTP.
Rename the plugins folder (ex plugins_old), logging in now will cause all plugins to disable.
Rename the directory of your specific plugin, logging in now will cause this plugin to disable.
Download the file you edited in the WordPress dashboard, undo your edits and upload it again.

Resources