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

Så här säkrar du dina WordPress-sidor med SSL (steg för steg)

SSL står för Secure Sockets Layer. Det är en teknik som ser till att all information som utbyts mellan din webbplats och dess besökare är säker. Den skyddar till exempel känsliga uppgifter som personuppgifter, lösenord och betalningsinformation.

Att säkra din WordPress-webbplats med SSL är avgörande för att skydda dina data och bygga upp användarnas förtroende.

SSL är så viktigt att vi använder det på alla våra webbplatser. Och idag ska vi visa dig hur du enkelt kan säkra dina WordPress-sidor med SSL, steg för steg.

Secure your WordPress Pages with SSL

Varför använda SSL för att skydda dina WordPress-sidor?

Ett SSL-certifikat är nödvändigt för alla webbplatser som hanterar känslig information eftersom det krypterar de uppgifter som överförs mellan din webbplats och besökarna. Detta gör det svårt för hackare att komma åt informationen.

Det lägger också till ett HTTPS-hänglås i webbläsarens adressfält för att försäkra besökare om att din webbplats är säker, vilket skapar förtroende och trovärdighet.

Website secure with SSL

Dessutom prioriterar sökmotorer som Google webbplatser som använder SSL, vilket ger dig en konkurrensfördel i sökresultaten.

Om du har en webbutik måste du också lägga till ett SSL-certifikat på din webbplats eftersom många betalningsgateways kräver SSL för säkra transaktioner.

Hur man skaffar ett SSL-certifikat

Innan du kan säkra dina sidor med SSL måste du köpa ett certifikat från en myndighet som GoDaddy eller Cloudflare. Detta kan kosta dig cirka $ 50-200 / år.

Du kan dock också få ett gratis SSL-certifikat med Let’s Encrypt. Det är en ideell certifikatutfärdare som låter dig få ett SSL-certifikat gratis.

Let's Encrypt

Sedan måste du installera SSL-certifikatet på din server. Mer information om hur du gör detta finns i vår guide om hur du går från HTTP till HTTPS.

Alternativt erbjuder många populära hostingföretag, som Bluehost och Hostinger, också ett gratis SSL-certifikat med alla sina hostingplaner. På så sätt slipper du krånglet med att installera SSL-certifikatet på egen hand.

Mer information finns i vår handledning om hur du skaffar ett gratis SSL-certifikat för din WordPress-webbplats.

SSL certificate settings in Cpanel

Med det sagt, låt oss ta en titt på hur du enkelt kan säkra dina WordPress-sidor med SSL.

Så här säkrar du dina WordPress-sidor med SSL

När SSL-certifikatet har konfigurerats på din server måste du installera och aktivera insticksprogrammet Easy HTTPS Redirection. För mer information, se vår handledning om hur du installerar ett WordPress-plugin.

Efter aktivering besöker du sidan Inställningar ” HTTPS-omdirigering från WordPress instrumentpanel och markerar alternativet Aktivera automatisk omdirigering till HTTPS”.

Enable automatic HTTPS redirection

Därefter kan du välja ”Hela domänen” bredvid alternativet ”Tillämpa HTTPS-omdirigering på”. Detta kommer att säkra alla sidor på din WordPress-webbplats med SSL.

Men om du bara vill säkra specifika sidor som betalningssidan eller registreringssidan kan du markera alternativet ”Några sidor”. När du har gjort det lägger du till webbadressen för den sida där du vill lägga till ett SSL-certifikat.

Du kan också lägga till flera webbadresser genom att klicka på ”+”-knappen.

Apply SSL to specific pages

Därefter måste du markera alternativet ”Tvinga resurser att använda HTTPS-URL”. Detta kommer att säkra annat innehåll på din webbplats, t.ex. bilder, videor, PDF-filer eller ljud.

Låt oss till exempel säga att du har bäddat in en video på din webbplats med en URL som inte är HTTPS. Den här inställningen konverterar automatiskt länken till HTTPS för att göra din video säker.

Add HTTPS for resources

När du är klar klickar du på knappen ”Save Changes” för att lagra dina inställningar.

Besök nu en sida på din WordPress-webbplats som du har säkrat med SSL. Här kommer du att se meddelandet ”Anslutningen är säker” högst upp, vilket säkerställer att dina inställningar har tillämpats.

Secure connection with SSL preview

Bonus: Så här åtgärdar du vanliga SSL-fel i WordPress

Om du byter webbplats från HTTP till HTTPS med SSL kan det ibland uppstå oväntade fel som påverkar användarupplevelsen negativt.

Felmeddelandet NET::ERR_CERT_INVALID kan t.ex. visas för användare som besöker din webbplats med Google Chrome. Meddelandet varnar användarna för att deras anslutning till din webbplats är osäker.

NET::ERR_CERT_INVALID error message

Det indikerar i princip att användarens webbläsare inte accepterade SSL-certifikatet som presenterades av webbplatsen. Den vanligaste orsaken till detta är ett utgånget SSL-certifikat.

I så fall kan du helt enkelt kontakta certifikatutfärdaren eller värdföretaget som utfärdade SSL och de kommer att fixa det åt dig.

Utöver det kan en flytt till HTTPS också orsaka felet”För många omdirigeringar. Detta kan hända om din webbplats av misstag skapar flera HTTPS-omdirigeringar för samma sida, vilket skapar en loop.

Too many redirects error message

Du kan enkelt åtgärda detta genom att lägga till följande kod i din wp-config.php-fil precis före raden som säger: ”Det var allt, sluta redigera! Trevlig bloggning”:

define('FORCE_SSL_ADMIN', true);
// in some setups HTTP_X_FORWARDED_PROTO might contain
// a comma-separated list e.g. http,https
// so check for https existence
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
       $_SERVER['HTTPS']='on';

Mer information finns i vår steg-för-steg-handledning om hur du åtgärdar vanliga SSL-problem i WordPress.

Vi hoppas att den här artikeln har hjälpt dig att lära dig hur du säkrar dina WordPress-sidor med SSL. Du kanske också vill läsa vår nybörjarguide om hur du lägger till gratis SSL i WordPress med Let’s Encrypt och vår jämförelse av TLS vs SSL: vilket protokoll du bör använda för 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.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

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.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

34 kommentarerLämna ett svar

  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. THANKGOD JONATHAN says

    I am a little confused here. Is setting up SSL for the main site and for pages different?
    I mean do I need to set up SSL for my site and also set up for pages again differently?

    • WPBeginner Support says

      This is one of our older articles, it is better to set up SSL for the entire site.

      Administratör

  3. Zaid Sparrow says

    I’m using SSL on my WordPress and i created a sub domain but i dont know why it’s redirecting sub domain to main website?

  4. Saurabh says

    With premium SSL by godaddy statndard SSL certificate comes free.So may I know what actually is the difference.For e-commerce website should I use it only on checkout page or it can be used for all pages ?

  5. ThirstyJon says

    This plugin author has not updated the plugin since March of 2013.

    I noticed in the support forum for the https plugin that several people (including me) are having a problem with the plugin forcing the search form to be insecure.

    This causes a note in Google Chrome that a form on the page is not secure.

    Who is going to shop on a site that says a ”form” is insecure?

    The https plugin has a function that forces all pages that are not set to ssl to be non-ssl.

    This is handy because I have at least one page on my site that will not work if the page is forced to ssl.

    So I have to choose between having the search form OR having the one page work.

    I am wondering if there is another plugin you could recommend that is actually kept up to date?

  6. Jason C. says

    how about changing the images that are unsecure manually instead of using a plugin? I’ve done it before, but can’t for the life of me remember how I did it.

  7. Fahad M Rafiq says

    After the Google announced that SSL is now a ranking factor. Everyone is rushing towards moving their website to HTTPS.

    But most people do not realize there are many things people forget to do, like for example blocking HTTP pages from indexing and submitting HTTPS website to Google Webmaster tools again.

  8. Jeff Dworkin says

    I am trying to use the bluehost Free Shared SSL Certificate.

    I get a 404 error on any page that I for which I click ”Secure Post”

    Does anyone have any idea about what I may have set up incorrectly.

  9. lbbb2 says

    what happens if the plugin is causing a redirect loop. I checked all my plug ins and the wordpress https was what is causing it am i using it too much or am I using it wrong I followed all of the instructions and still loops.

    • Tom says

      What was the time lapse between you getting your SSL cert and you installing the plugin? I had this same issue when I had purchased the SSL cert the time lapse between me going to sleep and getting up in the morning had rectified the problem.

      I believe this has something to do with your hosting company setting up your domain with an SSL cert.

      TLDR: Allow time for your cert to be correctly set up as it access CNAME records to do this which can cause issues.

  10. Allen Resha says

    So I used this plugin. It works great, except my blog 404’s when I use any permalink structure other than default. All other pages work fine. If I take the Force SSL off of my home page and blog, it fixes the problem, but I want my homepage and my blog page (that lists my posts) to be secure.

    What do you suggest? Help would be appreciated. I am testing on my site (which is being rebuilt), but I need it on a site for a social good project. This is really holding back my process! Your help would be greatly appreciated. I will show you much Twitter/Facebook/Google + and any kind of love you need! :)

  11. Danny says

    I added the plugin as well as the Fix Non-SSL plugin and I still get the insecure data warning. Any suggestions?

  12. Ariel Frailich says

    Hi! If memory serves (it’s been years), when you install a cert, you specify a folder to be secure. For WP, is this folder in the WP path or outside of it, and if outside, what has to be moved into it? Or should SSL be set up to include the whole site? Thank you for any info (or link to such) !

    • Editorial Staff says

      You are getting this error because your SSL certificate is not trusted. Where did you purchase the SSL from? Are you sure that it is properly installed. Just purchasing the certificate doesn’t do anything. You have to make sure that it is installed on your server as well.

      Administratör

  13. RichardC says

    Excellent post!
    Too bad the plugin author can’t be bothered to write any docs.
    Let’s hope he reads this article and asks permission to use it as the seed for a manual.
    Good Job to Staff on this Article!!

  14. Jon Tobey says

    I installed the plug in, but when I go to a page, I don’t see the ”force SSL” box. However, I do see an HTTPS box below the Page Attributes button. Has the UI changed?

  15. dalee says

    Is there a way to automatically do this? example using wp_insert_post() function then make the added post secure? without manually checking the checkbox?

  16. Yogi says

    Thank you for the information. I was going to do the old ways by using .htaccess, but this definitely saves me tons of time.

  17. Joshua says

    Thanks for the article. You really saved my butt. I could not figure the SSL out for the life of me. But after reading this I was able to get it working in 5min. High Five!

  18. wmwebdes says

    I’ve just started looking at SSL certificates.
    A client asked if I could set them up an eCommerce site, which I understand requires SSL for bank account details etc.
     
    Thanks for a timely article.

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.