How to Fix The '503 Error' in WordPress (Step-by-Step)

文章推薦指數: 80 %
投票人數:10人

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



請為這篇文章評分?