How to Fix The '503 Error' in WordPress (Step-by-Step)
文章推薦指數: 80 %
The 503 error occurs when your website server cannot be reached – i.e., the server is unavailable. The reasons for unavailability can be a badly ... HowtoFixThe‘503Error’inWordPress(Step-by-Step) LastUpdated:January26,2022 Postedin:WordPressTutorials Leaveacomment Themeislecontentisfree.Whenyoupurchasethroughreferrallinksonoursite,weearnacommission.LearnMore Haveyouencounteredthe503erroronyourWordPresssite?It’sacommonWordPresserrorthatcanbefixedbyfollowingthestepswehavecoveredintoday’stutorial. Someofthesestepsmaylooktechnical,buttheyactuallydon’trequireanydeeptechnicalknowledge. Inthisarticle,wewillfirstdiscusswhatcausedthe503errorinWordPress,thenwewillshowyouallpotentialsolutionsandhowyoucanpreventencounteringthe503errorinthefuture. Let’sdivein! Howtofixthe503error(WordPress) DeactivatepluginstemporarilyDeactivateyourthemetemporarilyDisableyourCDNtemporarilyLimitWordPressHeartbeatAPIEnableWP_DEBUG Whatisthe503error?Whatcausesit? The503erroroccurswhenyourwebsiteservercannotbereached–i.e.,theserverisunavailable.Thereasonsforunavailabilitycanbeabadlycodedpluginortheme,acodesnippetgonerogue,aglitchintheserver,aDDoSattack,orqualityissueswithyourhostingserviceoverall. Howtofixthe#503#errorin#WordPress(step-by-step)🤯 ClickToTweet Let’stakeadeeperlookateachofthecauses: Badlycodedpluginortheme: Commonly,the503errorappearswhenyouinstallorupdateabadlycodedpluginortheme.Whenthepluginorthemecannotfunctionproperly,itcausesWordPresstothrowthe503error. Codesnippetgonerogue: CustomizingaWordPresssiteissupereasy.YoucanaddsomeCSScodehere,uploadaPHPscriptthere,andmodifythesitebasedonyourneeds.But,apieceofbadcustomcodecancausealotoftrouble.The503erroryouareexperiencingcouldbeduetosuchabadcodesnippet. Badwebhostingsetup: Wealllovesharedhostingservicesbecauseoftheaffordabilityfactor,butrarelydoweconsiderthedownsidesofsuchsetups.Hostingyourwebsitewithotherunknownwebsitesonthesameservermeansanyofthewebsitescanendupoverusingtheserver’sresources.Yourwebsitemayhavebeendeprivedofitsresources,whichcausedthe503errors. Technicalissuesoftheserver: Yourservercouldbedownbecauseit’sundermaintenance,orbecauseofsomeotherscheduledwork.Usually,anyissuesresultingfromthesereasonsdisappearafteracoupleofhours.Thatsaid,hostingprovidersshouldhavemirrorserverstoensurethatthesitesareupandrunningduringmaintenance. ADDoSattack: Althoughthisdoesnothappenveryfrequently,the503errormighthavebeenproducedduetoanattackmadeonyourwebsite.DDoSattacks,inparticular,areoftenassociatedwith503errors.That’sbecause,inthesetypesofattacks,hackerssendatonoftraffictoyourwebsitesothattheservergetsoverloadedandcrashesyoursite.ReadmoreaboutDDoSattacksonWordPresssitesandhowtomitigatetheriskhere. Thesearethetypicalreasonsthatcausethe503erroronWordPresssites. It’sworthnotingthatthereareafewdifferentvariationsoftheerror: “503ServiceUnavailable”“503ServiceTemporarilyUnavailable”“HTTPServerError503”“HTTPError503”“Error503ServiceUnavailable”“Theserveristemporarilyunabletoserviceyourrequestduetomaintenancedowntimeorcapacityproblems.Pleasetryagainlater.” 👉Thesolutionsthatwehavecoveredbelowshouldfixany503erroronaWordPresswebsite. Howtofixthe503error(WordPress) Theexactfixthatisgoingtoworkforyoudependsontherootcause.The503erroritselfdoesnotgiveyoumuchinformationtogoon.Sointhissection,wewillshowyouanumberofstepstofollowinordertopinpointthecauseandthenfixit. Beforewediveintothesolutions,makesureyouarecarryingoutthefollowingpreliminarysteps: The503errorWordPressalsooccurswhenyouareupdatingapluginoratheme.Youmightwanttocheckyourwebsiteagaintoseeifitwasatemporaryissue.Justmakesureyouclearedthecachebeforecheckingthesite. AsImentionedearlier,sometimesthe503erroroccursbecauseofmaintenanceworkonyourwebserver.Youmusthavebeenalertedaboutitviaemailbyyourhostingprovider.Inatypicalmaintenancealert,youareinformedabouthowlongtheserverisexpectedtobedown.Socheckyouremail. Bluehostscheduledmaintenanceemail Iftheerrorappearedrightafteryouaddedacodesnippettoyourwebsite,thenyouknowwhotheculpritis.Removethecodeandyourwebsiteshouldgobacktonormal.Butifyou’velostaccesstoyourdashboard,thenwesuggestrestoringabackupofyourwebsite.Yourhostingprovidershouldbeabletohelpyououtwiththis. Nothingworked?Thenlet’strythestepsbelow. 1.Deactivatepluginstemporarily 503errorsarecommonlycausedbypluginsthatyouhaveinstalledonyoursite.Todetermineifaplugincausedtheerror,youwillneedtodisableallthepluginsonlytemporarily. The503errorpreventsyoufromaccessingthedashboard,soyouwillhavetouseanFTPclientlikeFileZilla. OpenFileZilla,connectwithyoursite,andnavigatetothepublic_htmldirectory.Openthefolderandnavigatetothewp-content.Insidethisdirectory,you’llfindanotheronecalledplugins.Itcontainsallyoursite’splugins(activeandinactive).Renamethepluginsdirectorytoplugins_orwhateverelse.Thiswilldeactivateeverypluginonyoursite. Disablingallpluginsbyrenamingthemainplugindirectory Gobacktoyoursiteagainandseeifthe503errorisgone.Ifitis,thenit’ssafetoassumethatapluginwascausingtheerror. Now,it’stimetopinpointtheexactpluginthat’scausingtheissues. GobacktoFileZilla,changebackthenameofyourpluginsdirectorytotheoriginal(“plugins”).Goinsideandstartworkingthroughallyourpluginsonebyone.Dothis: Changethenameofthefirstplugininthedirectorytosomethingelse.Checkthewebsitetoseeiftheerrorisgone.Ifitisindeedgone,you’vefoundyourculprit.Ifnot,changebackthenameofthatfirstpluginandproceedtotestthenextonethesameway.Repeatuntilyoufindthepluginthat’scausingtheproblems. Onceyoufindtheplugincausingtheerror,it’sbesttojustdeleteitandlookforanalternative.Ifnoneofyourpluginsiscausingthe503error,thentrythenextsolution. 2.Deactivateyourthemetemporarily Deactivatingthethemeisabittrickybecauseyoucan’tsimplyrenamethethemefolderaswedidwiththepluginsfolder.Itwouldleadtoanerrorofitsown. Sohere’swhatyouneedtodo:logintoyourhostingaccount,gotothecPanelsectionandopenthephpMyAdmin. Selectwp_optionsandgotoSearch.Underoption_name,writetemplateandclickonGo. FindingyourcurrentthemeinPHPMyAdmin Thesystemwillrunasearchandthenshowyouyourcurrentthemeunderoption_value.SelectEditandchangethecurrentthemetotwentytwentyone. EditingcurrentthemeinPHPMyAdmin Ifthisfixestheerror,thenyoumightwanttotrygettinganearlierversionofthetheme(onethatworked),installingit,andwaitingforthetheme’sdevelopertoreleaseanupdate.Or,youcanswitchtoadifferentthemealtogetherifthat’sanoption. 3.DisableyourCDNtemporarily Occasionally,CDNsareknowntocause503errors,sodisablingit–ifyouhaveoneworkingonyoursite–canbeaquicksolution.AllCDNshavesomeoptionthatallowsyoutopausethemmanually.Forinstance,onCloudflare,youneedtologintoyouraccount,selectyourwebsite,andclickonthePauseCloudflareonsiteoption. Next,checkyourwebsiteandifthe503errorpersists,thenunpausetheCDNandtrythenextsolution. 4.LimitWordPressHeartbeatAPI TheHeartbeatAPIisresponsibleforseveralessentialfunctions,likeauto-savingposts,showingpluginnotifications,preventingyoufromaccessingapostwhensomeoneelseismodifyingit,etc. TheAPIusesyourserverresourcestocarryoutthesefunctions.Ifyourservercan’thandletheAPI’sdemands,itwillthrowa503error.TodetermineiftheHeartbeatAPIiscausingtheerror,youneedtodisableittemporarily. OpenyourFTPclient(FileZilla),connecttoyourwebsiteandgotopublic_html→wp-content→themes.Openthecurrentthemedirectoryanddownloadacopyofthefunctions.phpfile,theneditit. Locatingfunction.phpfile Addthefollowingcodesnippetrightaftertheopening
延伸文章資訊
- 1How to Fix 503 Service Unavailable Error in WordPress
The 503 service unavailable error occurs when your web server is unable to get a proper response ...
- 2How to Easily Resolve the 503 Service Unavailable Error in ...
- 3How to fix 503 Service Unavailable Error in WordPress (2022)
How To Fix 503 Service Unavailable Errors When Using WordPress (Hint: It Means Your Website Is Ex...
- 4How to Fix 503 Service Unavailable Error: 7 Steps That Work
The 503 service unavailable error can happen due to connectivity issues between the server chain ...
- 5How to Fix the HTTP Error 503 Service Unavailable - Kinsta