Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Puchar WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Jak prawidłowo przenieść WordPress z HTTP na HTTPS (przewodnik dla początkujących)

Uwaga redakcyjna: Otrzymujemy prowizję z linków partnerskich na WPBeginner. Prowizje nie mają wpływu na opinie i oceny naszych redaktorów. Dowiedz się więcej o Proces redakcyjny.

Czy chcesz przenieść WordPress z HTTP na HTTPS i zainstalować certyfikat SSL na twojej witrynie internetowej?

Otrzymaliśmy wiele zapytań na ten temat, ponieważ Google ogłosiło w lipcu 2018 r., że przeglądarka Chrome będzie oznaczać wszystkie witryny internetowe bez SSL jako niezabezpieczone.

W tym artykule pokażemy, jak prawidłowo przenieść WordPress z HTTP na HTTPS poprzez dodanie certyfikatu SSL.

Moving WordPress from HTTP to HTTPS / SSL

Nie martw się, jeśli nie masz pojęcia, czym jest SSL lub HTTPS. Wyjaśnimy to również.

Co to jest HTTPS?

HTTPS lub Secure HTTP to metoda szyfrowania, która zabezpiecza połączenie między przeglądarką użytkownika a twoim serwerem. Utrudnia to hakerom podsłuchiwanie połączenia.

Każdego dnia udostępniamy nasze dane osobowe różnym witrynom internetowym, czy to dokonując zakupu, czy po prostu logując się.

Aby zabezpieczyć transfer danych, należy utworzyć bezpieczne połączenie.

Wtedy właśnie pojawiają się SSL i HTTPS.

Każda witryna otrzymuje unikatowy certyfikat SSL w celu identyfikacji. Jeśli serwer udaje, że korzysta z protokołu HTTPS, a jego certyfikat nie jest zgodny, większość nowoczesnych przeglądarek ostrzega użytkownika przed połączeniem się z witryną internetową.

Connection not private error in Google Chrome

Teraz pewnie zastanawiasz się, dlaczego muszę przenieść moją witrynę WordPress z HTTP na HTTPS, zwłaszcza jeśli jest to prosty blog lub witryna internetowa małej firmy, która nie pobiera żadnych płatności.

Dlaczego potrzebujesz HTTPS i SSL?

W 2018 roku Google ogłosiło plan poprawy ogólnego zabezpieczenia sieci poprzez zachęcanie właścicieli witryn internetowych do przejścia z protokołu HTTP na HTTPS. W ramach tego planu ich popularna przeglądarka internetowa Chrome oznaczałaby wszystkie witryny internetowe bez certyfikatu SSL jako „Niezabezpieczone”.

Connection not secure

Google stwierdziło również, że witryny internetowe z SSL również odniosą korzyści SEO i uzyskają wyższe rankingi wyszukiwania niż witryny niezabezpieczone. Od tego czasu wiele witryn internetowych przeszło z protokołu HTTP na HTTPS.

Po ogłoszeniu, Google rozpoczęło wdrażanie ostrzeżenia „Not Secure” w Chrome. Na przykład, jeśli ktoś przejdzie na witrynę internetową HTTP przy użyciu okna incognito, zostanie ona oznaczona jako Niezabezpieczona. Jeśli ktoś przejdzie na stronę HTTP w zwykłym trybie i spróbuje wypełnić formularz kontaktowy lub inny formularz, witryna internetowa zostanie oznaczona jako niezabezpieczona.

Kiedy twoi czytelnicy i klienci widzą to powiadomienie, daje im to złe wrażenie o twojej firmie.

Dlatego wszystkie witryny internetowe muszą natychmiast przejść z HTTP na HTTPS i zainstalować SSL.

Nie wspominając już o tym, że jeśli chcesz akceptować płatności online na swojej witrynie internetowej e-handel, potrzebujesz SSL.

Większość firm płatniczych, takich jak Stripe, PayPal Pro, Authorize.Net itp., będzie wymagać bezpiecznego połączenia przed zaakceptowaniem płatności.

Używamy SSL dla naszych witryn internetowych, w tym WPBeginner, OptinMonster, WPForms i MonsterInsights.

Wymagania dotyczące korzystania z HTTPS/SSL na witrynie WordPress

Wymagania dotyczące korzystania z SSL w WordPress nie są zbyt wysokie. Wszystko, co musisz zrobić, to kupić certyfikat SSL, a być może masz go już za darmo.

Najlepsze firmy hostingowe WordPress oferują darmowe certyfikaty SSL dla wszystkich swoich użytkowników:

Więcej szczegółów można znaleźć w naszym przewodniku na temat tego, jak uzyskać bezpłatny certyfikat SSL dla twojej witryny internetowej WordPress.

Jeśli twoja firma hostingowa nie oferuje bezpłatnego certyfikatu SSL, musisz go zakupić.

Zalecamy korzystanie z Domain.com, ponieważ oferują najlepszą ofertę SSL zarówno dla zwykłych, jak i wieloznacznych certyfikatów SSL.

Kupując u nich certyfikat SSL, otrzymujesz również pieczęć TrustLogo dla Twojej witryny internetowej, a każdy certyfikat SSL jest objęty minimalną gwarancją zabezpieczenia w wysokości 10 000 USD.

Po zakupie certyfikatu SSL należy poprosić dostawcę hostingu o jego zainstalowanie.

Konfiguracja WordPressa do korzystania z SSL i HTTPS

Po włączeniu certyfikatu SSL dla twojej domeny, będziesz musiał skonfigurować WordPressa tak, aby używał protokołów SSL i HTTP na twojej witrynie internetowej.

Pokażemy ci dwie metody, aby to zrobić i możesz wybrać tę, która najlepiej odpowiada twoim potrzebom.

Film instruktażowy

Subscribe to WPBeginner

Jeśli wolisz pisemne instrukcje, czytaj dalej

Metoda 1: Konfiguracja SSL/HTTPS w WordPress przy użyciu wtyczki

Ta metoda jest łatwiejsza i zalecana dla początkujących.

Najpierw należy zainstalować i włączyć wtyczkę Really Simple SSL. Aby uzyskać więcej informacji, zobacz nasz przewodnik krok po kroku, jak zainstalować wtyczkę WordPress.

Po włączaniu należy przejść na stronę Ustawienia ” SSL. Wtyczka automatycznie wykryje twój certyfikat SSL i skonfiguruje witrynę WordPress do korzystania z protokołu HTTPS.

SSL enabled on a WordPress website

Wtyczka zajmie się wszystkim, w tym błędami związanymi z mieszaną treścią. Oto, co wtyczka robi za kulisami:

  • Sprawdź certyfikat SSL
  • Ustawienie WordPressa tak, by używał https w adresach URL
  • Konfiguracjaprzekierowań z HTTP na HTTPS
  • Poszukaj adresów URL w twojej treści, które wciąż są wczytywane z niezabezpieczonych źródeł HTTP i spróbuj je poprawić.

Uwaga: Wtyczka próbuje poprawiać błędy mieszanej treści przy użyciu techniki buforowania wyjściowego. Może to mieć negatywny wpływ na wydajność, ponieważ zastępuje treść na witrynie podczas wczytywania strony. Wpływ ten jest widoczny tylko przy pierwszym wczytywaniu strony i powinien być minimalny, jeśli używasz pamięci podręcznej wtyczki.

Chociaż wtyczka mówi, że możesz zachować SSL i bezpiecznie wyłączać wtyczkę, nie jest to w 100% prawdą. Będziesz musiał pozostawić wtyczkę aktywną przez cały czas, ponieważ wyłączanie wtyczki spowoduje powrót błędów mieszanej treści. Więcej szczegółów można znaleźć w naszej recenzji Really Simple SSL.

Metoda 2: Ręczna konfiguracja SSL/HTTPS w WordPress

Ta metoda wymaga ręcznego rozwiązywania problemów i edytowania plików WordPress. Jest to jednak trwałe i bardziej zoptymalizowane pod kątem wydajności rozwiązanie, z którego korzystamy na WPBeginner.

Jeśli uważasz, że ta metoda jest trudna, możesz zatrudnić programistę WordPress lub skorzystać z pierwszej metody.

W ramach tej metody może być konieczna edycja motywu WordPress i plików kodu. Jeśli nie robiłeś tego wcześniej, zapoznaj się z naszym przewodnikiem na temat kopiowania i wklejania fragmentów kodu w WordPress.

Najpierw należy przejść na stronę Ustawienia ” Ogólne. W tym miejscu należy zaktualizować twoje pola adresu URL WordPress i witryny, zastępując http na https.

Update WordPress URLs

Nie zapomnij kliknąć przycisku „Zapisz zmiany”, aby zapisać twoje ustawienia.

Po zapisaniu ustawień WordPress wyloguje cię i zostaniesz poproszony o ponowne zalogowanie.

Następnie musisz skonfigurować przekierowania WordPress z HTTP na HTTPS, dodając następujący kod do twojego pliku .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

Jeśli korzystasz z serwerów NGINX, będziesz musiał dodać następujący kod, aby przekierować z HTTP na HTTPS w twoim pliku konfiguracyjnym:

server {
listen 80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}

Nie zapomnij zastąpić example.com nazwą twojej domeny.

Wykonując te kroki, unikniesz błędu WordPress HTTPS nie działa, ponieważ WordPress będzie teraz wczytywać całą twoją witrynę internetową za pomocą HTTPS.

Jeśli chcesz wymusić SSL i HTTPS na twoim obszarze administracyjnym WordPress lub stronach logowania, musisz skonfigurować SSL w pliku wp-config.php.

Dodaj następujący kod nad linią „To wszystko, przestań edytować!” w twoim pliku wp-config.php:

define('FORCE_SSL_ADMIN', true);

Ta linia pozwala WordPressowi wymusić SSL / HTTP w obszarze administracyjnym WordPress. Działa również w sieciach witryn WordPress.

Gdy to zrobisz, twoja witryna internetowa jest w pełni skonfigurowana do korzystania z SSL / HTTPS, ale nadal będziesz napotykać błędy mieszanej treści.

Błędy te są powodowane przez źródła (obrazki, skrypty lub arkusze stylów), które nadal są wczytywane przy użyciu niezabezpieczonego protokołu HTTP w adresach URL. W takim przypadku na pasku adresu twojej witryny internetowej nie będzie widoczna ikonka zabezpieczenia w postaci kłódki.

Not secure

Wiele nowoczesnych przeglądarek automatycznie blokuje niebezpieczne skrypty i zasoby.

Możesz zobaczyć ikonkę kłódki, ale z powiadomieniem o tym w pasku adresu twojej przeglądarki.

Insecure content blocked

Za pomocą narzędzia Inspect można sprawdzić, które treści są serwowane za pośrednictwem niezabezpieczonego protokołu.

Błąd mieszanej treści zostanie wyświetlony jako ostrzeżenie w konsoli ze szczegółowymi informacjami dla każdego elementu mieszanej treści.

Mixed content errors displayed in browser console

Zauważysz, że większość adresów URL to obrazki, ramki iframe i galerie obrazów, podczas gdy niektóre to skrypty i arkusze stylów wczytywane przez twoje wtyczki i motywy WordPress.

Poprawka mieszanych treści w bazie danych WordPressa

Większość nieprawidłowych adresów URL to obrazki, pliki, osadzanie i inne dane przechowywane w twojej bazie danych WordPress. Poprawmy je w pierwszej kolejności.

Musisz znaleźć wszystkie wzmianki o adresie URL twojej starej witryny w bazie danych, które zaczynają się od http i zastąpić je nowym adresem URL witryny, który zaczyna się od https.

Możesz to łatwo zrobić, instalując i włączając wtyczkę Search & Replace Everything. Aby uzyskać więcej informacji, zapoznaj się z naszym przewodnikiem krok po kroku, jak zainstalować wtyczkę WordPress.

Po włączaniu należy przejść na stronę Narzędzia ” WP Wyszukaj i zamień. W polu „Szukaj” należy dodać adres URL Twojej witryny internetowej z http. Następnie w polu „Zamień” dodaj adres URL Twojej witryny internetowej z https.

Add URLs into the search and replace fields

Poniżej zobaczysz wszystkie twoje tabele bazy danych WordPress. Musisz wybrać je wszystkie, aby przeprowadzić dokładną kontrolę.

Select all tables in Search & Replace Everything

Następnie kliknij przycisk „Podgląd wyszukiwania i zamiany”, aby zobaczyć wszystkie zmiany wprowadzone przez wtyczkę. Na koniec kliknij przycisk „Zamień wszystko”.

Click the Replace All button

Wtyczka przeszuka teraz twoją bazę danych WordPress pod kątem adresów URL zaczynających się od http i zastąpi je bezpiecznymi adresami URL https. Może to chwilę potrwać, w zależności od rozmiaru twojej bazy danych WordPress.

Poprawka błędów mieszanych treści w motywie WordPress

Innym częstym winowajcą powodującym błędy mieszania treści jest twój motyw WordPress. Każdy przyzwoity motyw WordPress zgodny ze standardami kodowania WordPress nie spowoduje tego problemu.

Po pierwsze, będziesz musiał użyć narzędzia Inspect twojej przeglądarki, aby znaleźć zasoby i miejsce, z którego są wczytywane.

Using inspect tool to find mixed content error

Następnie musisz znaleźć je w twoim motywie WordPress i zastąpić je https. Będzie to trochę trudne dla większości początkujących, ponieważ nie będziesz w stanie zobaczyć, które pliki motywu zawierają te adresy URL.

Poprawka błędów mieszanych treści spowodowanych przez wtyczki

Niektóre zasoby o mieszanej treści będą wczytywane przez wtyczki WordPress. Każda wtyczka WordPress zgodna ze standardami kodowania WordPress nie spowoduje błędów mieszanej treści.

Nie zalecamy edytowania plików wtyczek WordPress. Zamiast tego należy skontaktować się z autorem wtyczki i poinformować go o tym. Jeśli nie odpowiedzą lub nie będą w stanie tego poprawić, powinieneś znaleźć odpowiednią alternatywę.

Uwaga: Jeśli z jakiegoś powodu nadal napotykasz błąd mieszanej treści, zalecamy tymczasowe korzystanie z wtyczki Really Simple SSL, aby nie wpływać na użytkowników, podczas gdy poprawisz problem na witrynie przejściowej lub zatrudnisz programistę.

Prześlij swoją witrynę HTTPS do Google Search Console

Wyszukiwarki takie jak Google uważają https i http za dwie różne witryny internetowe. Aby uniknąć problemów z SEO, musisz poinformować Google, że Twoja witryna internetowa została przeniesiona.

Aby to zrobić, wystarczy przejść do twojego konta Google Search Console i kliknąć przycisk „Dodaj właściwość”.

Add property

Spowoduje to wyświetlenie wyskakującego okienka, w którym należy utworzyć nowy adres https twojej witryny internetowej.

Istnieją dwie metody weryfikacji witryny: nazwa domeny lub prefiks adresu URL. Zalecamy metodę prefiksu adresu URL, ponieważ jest ona bardziej elastyczna.

Add website URL in Google Search Console

Następnie Google poprosi Cię o zweryfikowanie własności Twojej witryny internetowej.

Można to zrobić na kilka sposobów. Wybierz dowolną metodę, a otrzymasz instrukcje dotyczące weryfikacji twojej witryny. Zalecamy skorzystanie z metody tagów HTML.

HTML tag method to verify your site

Zobaczysz teraz fragment kodu HTML, który musisz dodać do sekcji head twojej witryny internetowej WordPress.

Dodawanie kodu weryfikacyjnego Search Console za pomocą All in One SEO

Najpierw zainstaluj i włącz wtyczkę All in One SEO for WordPress. Aby uzyskać więcej informacji, zapoznaj się z naszym poradnikiem na temat instalacji wtyczki WordPress.

Uwaga: Istnieje również darmowa wersja All in One SEO, którą można wypróbować.

Po włączaniu przejdź do strony All in One SEO ” Ustawienia ogólne i kliknij Google Search Console.

Add Google Search Console verification code in All in One SEO

Poniżej należy dodać kod weryfikacyjny skopiowany wcześniej z witryny internetowej Google Search Console.

Nie zapomnij kliknąć przycisku „Zapisz zmiany”, aby zapisać twoje ustawienia.

Następnie przełącz się z powrotem na kartę Google Search Console i kliknij przycisk „Weryfikuj”.

Verify ownership

Gdy twoja witryna zostanie zweryfikowana, Google wyświetli tutaj raporty Search Console.

Musisz również upewnić się, że zarówno wersja https, jak i http są dodane do twojej Search Console.

Informuje to Google, że chcesz, aby wersja https Twojej witryny internetowej była traktowana jako wersja podstawowa. W połączeniu z przekierowaniami 301, które skonfigurowałeś wcześniej, Google przeniesie twoje rankingi wyszukiwania do wersji https witryny internetowej i najprawdopodobniej zauważysz poprawę w rankingach wyszukiwania.

Mamy nadzieję, że ten artykuł pomógł Ci dodać HTTPS i SSL w WordPress. Możesz również zapoznać się z naszym przewodnikiem po zabezpieczeniach WordPress z instrukcjami krok po kroku, aby Twoja witryna WordPress była bezpieczna lub z naszymi eksperckimi wyborami najlepszych rozwiązań analitycznych dla WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Ujawnienie: Nasze treści są wspierane przez czytelników. Oznacza to, że jeśli klikniesz na niektóre z naszych linków, możemy otrzymać prowizję. Zobacz jak WPBeginner jest finansowany, dlaczego to ma znaczenie i jak możesz nas wspierać. Oto nasz proces redakcyjny.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Najlepszy zestaw narzędzi WordPress

Uzyskaj BEZPŁATNY dostęp do naszego zestawu narzędzi - zbiór produktów i zasobów związanych z WordPressem, które każdy profesjonalista powinien mieć!

Reader Interactions

406 komentarzyZostaw odpowiedź

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Weslry says

    This article is a little bit trap for newbie because if you first change to https in your wp panel and then try to add those codelines to right files you can’t reach your webiste or wp admin panel. (443 error) I had to edit files through ftp and made myself fool at work for making such a mistake. So first you have to get the certificates and edit htaccess file etcetc and then add that S in your wp admin panel (or directly edit thorugh ftp).

  3. Huseyn says

    Hi! Thank you for this article. Very useful!

    But I was faced with one problem. After installing SSL (I use free version of Cloudflare SSL) I cannot edit any pages/posts/products. Does anybody face with such problem? And how did you solve it?

    Thanks in advance!

  4. Michael Penner says

    Thank you for the excellent and easy to understand article about WordPress and SSL. I was pleasantly surprised to see it was from one of my favorite plugin authors. Cheers!

  5. Maurizio Mau says

    Hi and many thanks for post,
    i have implemented SSL, run good on all bowser included mobile, load in 1.5 sec, console upgraded, analitucs upgraded, redirect done, fixed all element but ranking drop approx 20% and above…

  6. Onis Egwu says

    Hello There,

    Wonderful article. The issue I have with using the .htaccess file to route through https is that whenever WordPress updates, it cleans off the edits done.

    Is there a way to avoid this?

  7. max says

    hi there,
    i saw your post and is interesting..but i can’t understand one thing… I read you article and i made all about it … in admin area is ok all is https..

    but the front end no .. i mean when i see the site with chrome the padlock appear and then disappear ???!??!?!

    any ideas?

  8. Swapan Kumar Manna says

    Hello,

    I’ve purchased an SSL certificate form Godaddy and it is approved and downloaded the .crt file. I’m bit confused what are the next steps to install the file in the server and how to redirect all the URLs in the existing WordPress site. Can anyone give me the detailed guide step by step.

    Also requesting WPBeginer to write an article on this topic „How to install SSL certificate in Godaddy.

    Thanks.

  9. Rohit says

    Hi, as you said I went to my wordpress blog settings page and changed my domain url to https from http and clicked save however Now I am not able to login to my wordpress dashboard and getting 404 error.

    How can I solve this please becuase I cannot even login to my wordpress dashboard to change it back to http again

  10. Brody James says

    Hi,

    This worked great after following your steps. However, I notice that a few pages i.e. contact page does not display the green SSL lock but still displays https://

    How do I fix this?

    Thanks
    BJ

  11. Amin says

    all SSL redirections have problems with cookies didn’t found a solution from a year now. can someone help ? plz ? there is a big problem on auth cookies .. and got redirect to reauth=1
    there is no synch of cookies between front and backend , and authors get disconnected when they upload files .. I think it’s related to root/wp-load.php and /wp-admin/async-apload.php

  12. Amritosh Pandey says

    Please try this –

    # BEGIN WordPress

    RewriteEngine On
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule (.*) https://{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    • Joe says

      This Worked for me in my .htaccess file, all I needed to do was to change the port to „80”

      The htaccess snippet in the post just refused to work.
      thanks for this.

  13. Amy says

    Hi, just wanted to let you know I added Let’s Encrypt to my site and changed it in my WordPress dashboard it automagically updated the LOGIN page. I didn’t need to add the code to the wpconfig.php file.

    I wonder if this is a new addition to WordPress?

  14. Meenakshi says

    Hi,
    I recently moved my WP site from WP’s free hosting to another hosting site, the issue I’m facing is with SSL. Any help from here is appreciated?

  15. sujith says

    Hi , after converting to https i am getting error like

    „You do not have sufficient permissions to access this page” in wp-admin

    Not able to access wp-admin.

    When i revert the changes its working fine.

    Can anybody please help

  16. Bruce says

    My website is redirecting under
    https to a different website and I cannot find where the redirect is.

    Any ideas as to where to look would be appreciated.

    I have tested the plugins by disabling them.
    I have tested the themes by changing themes.
    I have looked at the htaccess.

    All works well except under https where it redirects to one of my other sites.

    Any help appreciated.

  17. Rrich says

    Hi,

    I changed the wordpress and site address at the General settings tab at wordpress from http to https. And I can’t access my site again.

    I now get your site is insecure when Ii type in he url.

    I can’t even access the admin.

    Please help

    • Karl D. says

      Don’t know if you got this fixed, but you can go into mysql (phpMyAdmin) and look for the table wp-options. There you will find a table entry titled „siteurl” and one titled „home” you can remove the s from https in the url there and your site will come back. I would make sure that you have the .htaccess and wp-config edited like stated in this article first and upload them to your site first and check if things work from there. If not, reset the .htaccess and wp-config file and edit the mysql like stated above and your site will come back when accessed without the https.

      Good luck!

      Best,
      Karl D.

      • Kalle says

        Thanks Karl ! This worked ! I just edited the files in (phpMyAdmin) !
        So if you mess with http / https settings with your wP try this !

        I tried to edit my .httaccess file for 2-3 hours….. :-o

  18. Moty says

    After activation and change force admin ti https can’t login- Page Not found 401
    can you please let me know how can I revert the changes?
    thanks

    • Moty says

      I have erased the plugin via file manager,
      Now can login to my wp admin but still can’t get into the plugins panel VIA Wp ,
      it is asking for an https address
      Please help
      Thanks

  19. Naeem Hussain says

    Dear Sir WPbeginner,

    I installed SSL + dedicated IP Certificate to my Wp Website name computerpakistan.com. Now its everything working fine, But problem with my website page speed.

    Before SSL Speed
    1.8 seconds
    After SSL Installation site page Speed
    4.3 Secondes by gtmatrix report

  20. Ritesh says

    I am not able to access the admin area after I uploaded define(’FORCE_SSL_ADMIN’, true); to wp-config.php. My site was already using wordpress https plugin with force ssl administration checked in. I removed that plugin using ftp but I am still not able to login. It says incorrect username or password. However neither the password nor the username has been changed. I think this was the problem after I tried adding define(’FORCE_SSL_ADMIN’, true); to wp-config.php. I can see the login page on https version of the site but not able to login. Please guide further.

      • The Platypus says

        I’m hopeful you ran a back up before doing any changes to your site.. in either case revert back your site to an earlier state via your database, and whatever back up of your config.php file you have.

      • Stephen says

        I had a similar problem after enabling FORCE_SSL_ADMIN in wp-config.php.

        The login page etc. was coming up ok over HTTPS but it wouldn’t let me login successfully.

        In this case, it was a plugin interfering – „Chap Secure Password Login”. After deactivating it, logins worked ok (and in fact, it’s not needed when WordPress is configured to force SSL on the admin page).

        So I would suggest checking any login related plugins and try deactivating them.

        Another issue is if you are using something like HAProxy in front of your webserver for load balancing, and get something like a „too many redirects” error message after trying to move WordPress to HTTPS.

        In this case, you most likely need to modify wp-config.php to tell WordPress that the connection is actually HTTPS, otherwise it will keep trying to redirect even when the client connection is over HTTPS. There are some details here,

  21. Raivat says

    Hi, I followed your tutorial. Thanks, Everything works! But I am getting an error when I load the home page saying „Your connection to this site is private, but someone on the network might be able to change the look of the page”. I checked it out and it seems there is a problem in one of my font resources which uses Google Fonts with http instead https, can you show me how can I fix this?

    Thanks :)

    • Sebastian says

      Try removing the „http://” from the Google Font call. So it’s not being forced across HTTPS. The reference call to the Google Font link should start with the „www.” instead of „http://”

  22. Mark Cohen says

    Everything working fine, except that when on Dashboard > Home I get exclamation mark across padlock in URL bar. Anyone know what content is being served insecurely on this page?

  23. Joel says

    I made the changes in the site before I set up the certificate and now can not access the back end of my site.

  24. David gillies says

    Hi followed your example and now cant access the website at all
    if I try

    all I get is jumbled page with no styling

  25. Adrienne says

    I need to do this soon for my nonprofit site, and I’m scared! :-) Paying for this is going to be extra too, but I have to do it!. Thanks for this info….

  26. Lourdes says

    So this comes up when I google my Blog Page. Using Bluehost/wordpress – DOES THIS MEAN O need to fix the SSL Cert issue aka buy from bluehost? Thank you!!!!

    [We didn’t find any SSL certificate present on the website which is bad for users privacy. The site has a title but meta description is absent, it will be better for SEO if both are present. Homepage is in English.]

  27. Penny says

    What if you have Mixed Content going on and were asked to fix that before you proceed with installing SSL?

    My Firewall, Sucuri said that I need to fix the mixed content before they can install the SSL. Now I’m stuck and do not know how to proceed. I’m nervous with installing plugins. They recommended really-simple-ssl plugin. Have you had any experience with this? I try to limit the using plugins…

  28. Jarred says

    We installed the plugin WordPress HTTPS (SSL). We chose to only use SSL on specific pages option and everything is working great. However we have two important questions that came about after reading the GOOGLE article about migrating to https. Not sure if I can share link on here, so this is the title „Secure your site with HTTPS” on support google.
    Questions.
    1. Does the plugin WordPress HTTPS (SSL) automatically create 301 redirects to help search engines know we moved to https on those specific pages?
    2. If the plugin does not create the 301 redirects, do WE need to go ahead and create the 301 redirects manually for those specific pages that we added SSL on? Thank you in advance

  29. adam vikar says

    For a multisite setup, is there a code we can use to force SSL on the main site and NOT a specific subdomain?

  30. Michelle says

    I put the wrong info in the SSL host box and now I get a 404 error. I cannot get back to any of my pages to disable the plugin or to change the info in the SSL host box. Please advise….

    • Easiest solution - delete the plug-in says

      The easiest solution is to delete the plug-in.

      Access the files on your server (If you are using cPanel, you can use 'File Manager’
      Browse to where the plug-ins are kept
      /wp-content/plugins

      Find the plug-in and delete it.

  31. Jithin Johny George says

    Hi,

    Awesome step-by-step guide.

    But the plugin you have mentioned,WordPress HTTPS (SSL) has not updated in years.

    Is there any alternative for the plugin ?

    Thank You

    • Penny says

      I was advised by my firewall company to use Really Simple SSL. I haven’t tried it yet but they highly recommend it.

  32. Kris Gabriel says

    Fantastic guide, simple and usefull.
    The only thing to worry about is that the redirects causes the page to slow a bit down.

    Is implementing the code listed above into the .access file the first choice or is it better with just a plugin?

    I´ve chosen both options, that means both a wordpress https plugin AND .access code.
    Would you say that is benicial or not?

    Kind regards
    Kris

  33. Mursaleen Kamal says

    Assalam Alaikum Sir: We Have Been Successfully Implement this Guide on Our Website But We Still Facing Redirect issue,

    Our Website Is Accessing from Both URL

    http and https

    and How to Resolve Mix Content Issue?

  34. Ali says

    Hello,
    Thank you for your guide. I add this code in my htaccess file
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L]

    but now it do not do 301 redirect it is doing 302 redirect.
    Please tell me is it ok to do 302 redirect or not.

    Regards

    • WPBeginner Support says

      A 301 redirect means that the page has permanently moved to a new location. A 302 redirect means that the move is only temporary. Search engines need to figure out whether to keep the old page, or replace it with the one found at the new location.

      Administrator

  35. Ana says

    Thanks for the article, but I should definitely have read it before adding the SSL and https to WP. Total newbie but somehow managing a wordpress site..

    Changed WP site address on the settings page from http to https after an update recommendation on my admin panel. But now I can’t access the website or admin page! All I get is a blank page with the message ERR_TIMED_OUT and site can’t be reached.

    I realised I hadn’t activated the free SSL certificate that comes with our web hoster. Now I have done that and I’ve tried adding a WP SSL redirect (http to https) code to the .htaccess file as well. And tried adding define force_SSL_admin to wp-config.php, but nothing has changed and I don’t know how to undo or fix the issue. Any suggestions or experience in this issue would be very helpful!

  36. mirko says

    sorry, but…I did not understand the part of .htaccess files … Must I add code to my htaccess or mix with my file ?
    my original file is the default wordpress file

    # BEGIN WordPress
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    # END WordPress
    

    The New file is correct ?

    # BEGIN WordPress
    
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80 
    RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L]
    
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    # END WordPress
    

    Thank you, Mirko

  37. g says

    after changing the url in general settings, all css styles are gone, and the wp-login page to change this setting is not showing because of to many redirects. be aware before using this tut, I have to back up.

  38. christopher says

    Thank you for your article! I was wondering though, my website recently has suffered some problems with „too many redirects” error. I wonder if adding the .htaccess code you mentioned in the article for ssl redirect will make the problem worse? Some visitors to my website said they often see „this page isn’t redirecting properly” when they come to our website. Could it be that our customers are having trouble visiting our website because I don’t have that code in my .htaccess file?

  39. Melvin says

    Hi! I was wondering if there’s a reason why you only want SSL on specific pages instead of the whole website? Could this be because of performance?

  40. Ahmed says

    Hello Syed! Great tutorial. I just want to ask that when ssl error window appears in browsers. Whether its the time to login,shopping or everytime you visit specific websit….For example if I have a blog which don’t offer login or shopping whteher ssl certificate is required or not???

  41. Jaclyn Mamuzich says

    Hello,

    For some reason our blog is not showing as https even though we have an ssl installed and I thought it was done before the migration but I could be wrong. I followed the steps in the article (greatly appreciated :) but for some reason when I complete all the steps, almost all of my styling disappears, specifically related to layout. Any suggestions?

    thanks!

    • Rob says

      As with JACLYN MAMUZICH. I have followed all the steps and when the site is viewed in https:// all the CSS has gone. Any suggestions?

Zostaw odpowiedź

Dziękujemy za pozostawienie komentarza. Pamiętaj, że wszystkie komentarze są moderowane zgodnie z naszymi polityka komentarzy, a Twój adres e-mail NIE zostanie opublikowany. NIE używaj słów kluczowych w polu nazwy. Przeprowadźmy osobistą i konstruktywną rozmowę.