wordpress wp-admin login doesnt work after wp-config edit - wordpress

I made a mistake by erroneously changing the site URL in general settings in Wordpress.
My website pages would load but I got a redirect loop back when trying to login on the wp-admin page.
To fix this I accessed my wp-config.php via SSH and added the following:
define('WP_HOME','http://swsportpsychology.co.uk');
define('WP_SITEURL','http://swsportpsychology.co.uk');
Now my website still loads as before but the wp-admin page will not load at all, so I cant login and it says cant access server.
How should I fix this? Any ideas?
Update
I have also added this to my themes functions.php:
update_option('siteurl','http://swsportpsychology.co.uk');
update_option('home','http://swsportpsychology.co.uk');
But still no fix.

Try adding this to your functions.php in your theme:
update_option('siteurl','http://swsportpsychology.co.uk');
update_option('home','http://swsportpsychology.co.uk');

Related

How to fix wp-admin not coming in the url issue in wordpress?

I am working on wordpress website https://www.iskconujjain.com suddenly some issues are coming although I have not done any major change in the website.
wp-admin are not coming in any admin url.
I am trying to change the Permalinks setting but it is not saving.
All pages are redirecting to home page although in the url having another page path.
for solve this problem you must regenerate permalink-
For solve it go to Settings > Permalink and save it.
Let me know.

Wordpress gives 404 in any page with any kind of permalink, but when I change the theme it works. How to fix?

I have a wordpress theme that has the page.php, but it gives 404 in any page that I create, even using the plain permalink (http://localhost:8080/?page_id=33141).
But when I change to wordpress theme the page works.
I think it is not about htacces, because none of the themes should work.
Could the theme redirect all pages to 404? I didn't find anything in the code.
Could someone refresh my mind?
Thanks.
I am running it in a docker container but I dont think it has influence because the other theme works.
Try go to setting->permalink and click save and clear cache and fresh page.
go to settings-> permalinks and save the permalinks and also clear the cache. sometime it is occurring due to cache.
And also sometimes it may happens due to permission is declined from cpanel
Go to cpanel and then right click select permission and change the permission. It may be helpful

wp-admin redirects to another page after automatic wordpress upgrade

Whenever I try to log into my wordpress site using mysite.com/wp-admin it redirects me to mysite.com/auto-login and giving a 404 error. It is happening with mysite.com/wp-login.php page as well. After go through my email i came to know that worpdress was upgraded automatically to 4.4.6. That means the problem started after the upgrade. Before that I could log into the site using wp-admin or login.php page without any problem.
Let me tell you what I did so far to solve it.
Edited the .htaccess file with the default code from wordpress.org site. Problem remained.
After that I deleted the file and uploaded a new one.
Did both through cpanel, but all in vain.
Update: I disabled my plugins one by one and found a faulty one. wp-admin or wp-login.php is now taking me to login page. But now the problem is it keeps redirecting to this same login page every time I enter my user name and password.
(Posted on behalf of the OP).
I have solved it. Let me tell you how.
I disabled my theme by renaming the folder.
I had no other theme in my directory so I uploaded twentysixteen theme.
I tried to login and It gave me a wrong password error which was weird because I did not change anything.
So I went through my phpMyAdmin and found that my password was changed I don't know how. Anyway I changed that and came back to login.
And voila! WordPress let me in!
Then I changed the theme to my previous real one and everything is OK now.

My wordpress wp-admin is not opening??Please give your suggestions

Yesterday, I created a blog for my site ayurprakash.com. All I did was
installing another wordpress in the existing one and replacing the
domain with blog.ayurprakash.com. I made changes in the settings for
the site and wordpress url and changed the url to
www.ayurprakash.com/blog. I installed several plugins and altered some
code inside blog folder. But now, when I run the url
www.ayurprakash.com/blog/wp-admin.Nothing appears. I changed the url
to www.ayurprakash.com/blog/wp-login.php. the front panel is opening
asking for username and password. But when I clicked the submit
button, nothing is displayed except the text--"Blocked". What should I
do in this case?
Try to turn WP_DEBUG in wp-config to true (located on line 81) and after trying to log in it will direct to the offending piece of code. Then remove that code.

Moving Wordpress site subdirectory errors

I have just moved my testing development subdirectory worpdress installation to my root folder using the WP-Clone plugin.
The problem now is my main site (previously mysite.com ) shows (mysite.com/site) now. and the subdirectory is shwoing in all my links
I have tried going to settings and removed the /site from wordpress URL and Site address URL.
But it broke my site and disabled me from accessing my wp-login.php .
I fixed it by editing my wp-config.php and adding :
define('WP_HOME','https://mysite.com/site');
define('WP_SITEURL','https://mysite.com/site');
and now my website works perfectly. But it still shows mysite.com/site and i am unable to edit my URL and Siteaddress from my wp dashboard anymore.
How do I Remove my website subdirectory (/site) and still have it work and not break my site's themes and all? How do I go about this? Really really appreciate any help! Thanks!
By adding those constants to wp-config.php you're overruling any setting in the database. That's why you can't edit them in the admin panel.
So the first step is to change those constants to:
define('WP_HOME','https://domain.com');
define('WP_SITEURL','https://domain.com');
Then delete your htaccess file. (.htaccess in your root folder).
Once you've done this navigate to http://domain.com/wp-login.php
Login to your site and go to Settings -> Permalinks. Hit save which will regenerate your htaccess file.
Finally you'll need to update existing links. I'd suggest installing a plugin called 'Velvet Blues Update URLs'.

Resources