15 Ways To Harden The Security Of Your WordPress Site
文章推薦指數: 80 %
15 WordPress Security Tips · Keep WordPress core, themes, and plugins up to date · Only install trusted WordPress plugins and themes · Remove ...
Skiptocontent
Blog
Security
15WaysToHardenTheSecurityOfYourWordPressSite
“Securityisnotaboutperfectlysecuresystems.Suchathingmightwellbeimpractical,orimpossibletofindand/ormaintain.Whatsecurityisthoughisriskreduction,notriskelimination.It’saboutemployingalltheappropriatecontrolsavailabletoyou,withinreason,thatallowyoutoimproveyouroverallposturereducingtheoddsofmakingyourselfatarget,subsequentlygettinghacked.”—codex.wordpress.org
WebsitesecurityisoftenatopconcernforWordPresssiteownersandprospects.While28percentofallwebsitesontheinternetarepoweredbyWordPress,becauseofits popularitytheCMSisoftentargetedbyhackers.However,thatdoesn’tmeanyoursitehastofallvictimtomaliciousbehavior.
Whilenosystemis100percenthack-proof,therearecertainmeasuresyoucantaketopreventahackedWordPresssite. Toreduceyourchancesofbeingaffectedbyadisastrousbrute-forceorDDoSattack,readbelowforthemostimportantWordPresssecuritytasksyoushould implementtobecomemoreproactiveagainstpotentialthreats.
15WordPressSecurityTips
KeepWordPresscore,themes,andpluginsuptodate
ThemostcommonculpritofahackedWordPresswebsiteisduetoanoutdatedcomponent.Outdatedplugins,themes,andcoreopentheportalforapotentiallyhackedsite.Whenleftun-updated,theseoutdatedfilesaretraceableand makeyoursiteatargetbyoutsideintruders.
Infact,inonestudy 54percentofreportedWordPresssecurityvulnerabilitiesbelongedtooutdatedWordPressplugins(outdatedWordPresscoreaccountedfor37percentandoutdatedWordPressthemesaccountedfor11percentofvulnerabilities).
EnsuringyourWordPresssiteisup-to-dateissimple.WhenyouseeanorangenotificationinyourWordPressdashboardnexttoplugins,themes,oranotificationtoupgradeWordPress,updateASAP!
IfyoursiteishostedwithWPEngine,we’llautomaticallyruntheseWordPresscoreupdatesforyou,althoughyouwillneedtobeattentivewiththemesandpluginstoupdatethemaccordinglytoprotectyourwebsitefrommalware.
ConsistentlyupdatingyourpluginsiskeytoanysuccessfulandsecureWordPresssite.Tohelpyoumanageyourpluginswithconfidence,WPEnginecreatedthe SmartPluginManager. SmartPluginManagerisanautomatedsolutionthatchecksyourpluginsforupdatesnightlyandensuresthatwhenupdateshappen,yoursitedoesn’tbreak.
Howtoconfigureautomaticupdates
Ifyou’drathernotdoitmanually,youcanconfigureautomaticupdates.Toauto-upgradeWordPresscore, insertthiscodeintoyourwp-config.phpfile:
define('WP_AUTO_UPDATE_CORE',true);
Forplugins,use:
add_filter('auto_update_plugin','__return_true');
Forthemes,use:
add_filter('auto_update_theme','__return_true');
OnlyinstalltrustedWordPresspluginsandthemes
OnWordPress.orgthe“Popular”and“Featured”sectionsoftheplugindirectoryareagoodplacetostartwhenlookingfortrusted,secureplugins.
Todetectifathemeorplugincanbetrustedornot,first,readitsratings.Thereyoucanfindcluestowhethertherehavebeensecuritybreachesorissuesinthepast,likebuggyupdates.
You’llalsowanttochecktoseewhenaplugin/themewaslastupdated.Ifapluginorthemehasn’treceivedanupdateinsometime(sayyears),thentheinactivenessinthatplugin/themeisasignyoushouldlooksomewhereelse.
Inaddition,analyzingapluginortheme’spopularityisanotherwaytobetterensureyouaren’tinstallingmaliciouscodeintoyourWordPresssite.
Aplugin/themethat’swidelypopularisn’t necessarilylesslikelytobetargetedbyhackersbutismorelikelytobeupdatedwithsecuritypatchesregularlyduetoitswideuse.
RemoveUnusedPluginsandThemes
Overtime,yourWordPresssitewillrequiresomehousekeeping.
Asyoustarttoaccumulatethemesandplugins,youshouldgothroughanddisposeoftheonesyounolongeruse. Gettingridofunnecessaryclutterislikelytomakeyoursiterunfaster,aswellasremovesecurityvulnerabilitiesfromstagnantoroutdatedadd-ons.
IfusingWordPressmultisite,tryusingapluginlikePluginActivationStatustoperformapluginauditanddetectunusedpluginsacrossallsitesinthemultisitenetwork.
Seethe codexonWordPresshousekeepingformoreinformationonhowtoremoveunusedpluginsandthemes.
InstallaWordPresssecurityplugin
InstallingaWordPress securityplugin isano-brainerwhenitcomestoenhancingthesecurityofyoursite.Tobecomemoreproactiveagainstsecuritythreats,tryinstallingapluginlikeoneofthesetominimizeanysecurityvulnerabilities.
(Ifyou’reaWPEnginecustomer,besuretocheckourdisallowedpluginslistasthereareafewWordPresssecuritypluginswealreadyinstallforyou.)
SucuriSecurity
iThemesSecurity
BulletproofSecurity
RegularlybackupyourWordPresssite
WPEngineoffersdailysitebackupsandone-clickrestoresoyoucanrestateaseknowingyourworkissafe.
Evenifyoutaketheabovesecurityprecautions(andtheoneslistedafter)youshouldalwaysbackupyourWordPresssite.
BackingupyourWordPresssiteisfairlyeasytodo,asgiventhese instructionsbyWordPress.OryoucantryapluginlikeBackupBuddy.
Ifit’ssomethingyou’drathernothavetoworryabout,WPEngineconductsautomaticbackupsforyoueveryday.Thatwayyoucanrollbacktoyouroriginalsite*should* youeverloseyoursitedueto anoutsideinvasion.
EnforceStrongPasswordsandUsernames
We’reallguiltyofusingapasswordthat’ssimpletoremember.Butusinganeasypassword,sayonethatcontainsyourbirthyear,makesiteasierforhackerstocrackthecodeusingbruteforceautomatedscripts,whichcontinuouslytrytoguessyourpasswordandusernameoverandover.
Toensureyourpasswordisstrongandsecureenough, useatoollike StrongPasswordGeneratororStrongRandomPasswordGenerator.
Youshouldalsoforceotherusersonyoursitetouseastrongpassword.YoucanuseaWordPresspluginlikeForceStrongPasswords toenforcestrongpasswords.(Ifyou’reaWPEnginecustomer,weautomaticallyinstallthispluginforyou.)
Usetwo-factorauthentication(2FA)
Enabling2FAaddsanextralayerofsecuritytoyourlogincredentials.2FAworksbyrequiringasecondfactorofinformationthatonlyyoucangive,likeacodesenttoyourphonetoverifyyouractivityonaspecificcomputer.
Thatwayit’sharderforanintrudertostealyourinformationiftheyloginthroughadifferent device.
HerearesomeWordPresspluginsyoucanusefor2FA:
GraphicSource:GoogleSupport
•GoogleAuthenticator
•DuoTwo-FactorAuthentication
•TwoFactorAuthentication
•Clef
•Authy
•Rublon2FA
AsaWPEnginecustomer,youcanimplement Two-Factorauthentication throughtheUserPortal.
Changeoromitthe“admin”username
Bydefault,WordPressgivestheprimarydomainaccounttheusername“admin”.Leavingtheusernameas“admin”isaninstantsecuritythreattoyoursite.Ifanattackerwantstocrackthecode,halfofthepuzzleisalreadysolvedandallthat’slefttoguessisyourpassword.
Removingorchangingthe“admin”usernameisthenextsteptoimprovingsitesecurity.Todothis,simplygotothe“users”sectionoftheWordPressadminpanelandrenameordeletethe“admin”accountorusername.
WPEnginedoesnotallowtheuseofthe“admin”usernameandwillautomaticallyremoveitforyou,replacingtheadminnamewitha“wpengineaccount”name.Thisaccountisusedbyoursupportteam.Weimplementspecialconfigurationstopreventattacksonthe“wpengine”useraccountspecifically.
LimitLoginAttempts
WordPressdoesn’thavealimitastohowmanytimesonecanguessapasswordtologin.Thispresentsaproblembecausedeterminedhackerswon’tgiveup.
Forexample,ahackercoulduseascripttoenterdifferentpasswordcombinations(calledbrute-forceattacks)until they’vecrackedthecode.
Toresolvethisissue,youshouldlimitloginattempts.Herearesomepluginsbuiltforlimitinglogins:
•LoginLockdown
•LimitLoginAttempts
• JetpackProtect
Topreventforgetfulcustomersoremployeesfromgettinglockedout,youcanalsowhitelistcertainIPaddresses(JetpackProtectisgreatforthis).
Ifyou’reonWPEngine,we’vealsobuilt proprietarysecurityintoourplatformtohelplimitloginattempts.
Monitor IncomingAttacks
It’svitaltologincomingsecurityattackssoyou’reawareofwhat’sgoingoninsideyourWPinstallationfromahistoricalperspective.Hereareacoupletoolsthatcanhelpyouwith malwaremonitoring:
•SucuriSecurity
• WPSecurityAuditLog
Gettinginsightintowhat’shappeninginyourWordPressinstallationviaawebsitemalwarescantoolisagoodideafortightersecurityandaneasierdiagnosisofanyissuesthatmightarise.YoucanalsousemalwareservicessuchasWPSecurityforcheck-upsandremoval.
UseSSLfordatasecurity
EnablingSSListhenextcrucialsteptoamoresecuresite.SSL(SecureSocketsLayer)encryptsallinformationsenttoandfromyoursite.Thatwaytheprivatedatavisitorssharewithyoursitestaysprivate.
UsingSSLensuresthathackerscan’tseeorinterceptthedatayourusersshareonyoursite.ThesecuretunnelSSLcreatesisespeciallyimportantwithsensitiveinformation,likecreditcardnumbers,usernames,andpasswords.
IdentifyingwhetherornotasiteisSSLcertifiedissimple.AnSSLcertifiedsitewillstartwithan HTTPSintheURLaddress,whileasitethat’snotSSLcertifiedwillbeginwith HTTP.
AnSSLcertificatehelpsauser’sbrowserverifythattheyarenotonlyaccessingasecurewebsite,butthecertificateisalsogenuineandlinkedtothedomain/websitethatwasrequestedbytheuser.
WithWPEngine,allcustomersareencouragedtoobtainafreeSSLcertificatewithLet’sEncrypt.
FormoreonSSLandLet’sEncrypt,checkoutTorque’sWhyLet’sEncryptHasCompletelyChangedTheSSLLandscape.
HideYourWordPressVersion
IfyoudeferWordPressupdates, youshouldconsiderhidingyourWordPressversionbecauseitleavesfootprints,tellingthehackerusefulinformationaboutyoursite.
TherearethreeareaswhereyourWordPressversionnumberwillbehidden:
1.Thegeneratormetatagintheheader:
延伸文章資訊
- 1A Beginner's Guide to Hardening WordPress Security
13 Ways to Harden a WordPress Site · 1. Install an SSL certificate · 2. Use strong passwords · 3....
- 2WordPress Hardening: 18 Ways to Harden Security of Your ...
WordPress hardening is a catch-all term used to describe settings and configurations that increas...
- 3An Overview of Basic WordPress Hardening - Sucuri Blog
Our website security analyst gives a brief overview of basic WordPress hardening tips and tricks ...
- 4WordPress Security - 19 Steps to Lock Down Your Site (2022)
Server hardening is the key to maintaining a thoroughly-secure WordPress environment. It takes mu...
- 5WordPress security & hardening, the definitive guide
Is WordPress secure? Plugins and themes. Run less software; Observe the least privileged principl...