• DevOps
    Case Study

    How we built a resilient multi-account, multi-cloud solution for a Health Tech service provider!

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How we built a scalable Odoo solution for a Travel Tech service provider!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    How we built a scalable Odoo solution for TravelTech service provider!

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Contact Us

Connect with us!


LinkedInFacebookXInstagramYouTube

aws partneraws advanced partner
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy

Replacing Wordpress core files using Git

Steve Martin

  • 4 min read
Replacing Wordpress core files using Git

Generating audio, please wait...

Sometimes clients open tickets saying their website has changed or the website redirects to something else. This means their website files got corrupted. If this is the case, we need to duplicate the same issue from our side by accessing the website and confirming the files are corrupted. In most cases, we can see the corrupted code with our bare eyes. In this blog, I am trying to solve such an issue that happened to a client.

Step 1: First login to the document root of the account and look at the index page and .htaccess file. In this case, the index page was corrupted and we could see it with our bare eyes. If it is not an index page then we can check other pages like wp-login.php etc.  As a first step change the file name of .htaccess with something else.

 

 Step 2:  Once confirmed we need to replace the WordPress core files from the official WordPress repo. For that, we need to confirm the WordPress version running on the website. It can be get from the version.php file under wp-includes or simply by typing the command:

#grep wp_version wp-includes/version.php

Which will show the WordPress version. Here it was '6.1.1'

Replacing Wordpress core files using Git-2.png

Step 3: Now we need to clone the WordPress version '6.1.1' files from the git https://github.com/WordPress/WordPress where under master click on the tags and select the appropriate WordPress version.

Replacing Wordpress core files using Git-3.png

Step 4: Next we need to clone the WordPress directory to the document root of the website. For that run the command  #git clone -b tag git_link directory_name  

#git clone -b 6.1.1 https://github.com/WordPress/WordPress.git wp

Replacing Wordpress core files using Git-4.png

 

Replacing Wordpress core files using Git-5.png

Step 5: Now if you list the files you could see the wp folder with WordPress files in it. So we need to replace the files in this directory with the existing website files. This step is very important because we can't just replace the files. The website contents are present in wp-content and the configuration file is wp-config.php. These files are important for the website and we can't replace the files which will break the website. So we use rsync command utility and the  --exclude option to exclude the files and directories and replace other files. 

First, run a dry run and see the result.  Run the command in the document root of the website:

#rsync -av --dry-run --exclude wp-content --exclude wp-config.php wp/ .

This will exclude the wp-content directory and wp-config.php. 

-a - for archive

-v - for verbosity

--dry-run - perform a trial run with no changes made

--exclude - for excluding the directory/file

Step 6: After confirming remove the --dry-run option 

#rsync -av --exclude wp-content --exclude wp-config.php wp/ .

Replacing Wordpress core files using Git-6.png

Step 7: Then put a new .htacess file and change the ownership of the files in the public_html

#chown -R username:username public_html/

Step 8: Now check the website. If the website still redirects then the database may also got corrupted and they need to work with their developer to sort out the problem.

Conclusion:

There are several reasons why WordPress files may become corrupted, including malware infections, Plugin or theme conflicts, Improper updates, and File permissions issues. It's important to regularly monitor and maintain website files to prevent corruption and ensure website functionality and security. This can include using reputable security plugins, performing regular backups, and regularly updating WordPress core, plugins, and themes. In this blog, I tried to resolve such an issue by replacing the WordPress core files. 

 

 

  • WordPress

Looking for AWS Experts?

We provide top-of-the-line custom AWS setup services tailored to your needs.

Replacing Wordpress core files using Git

Adding secondary IPs in Webuzo

Adding secondary IPs in Webuzo
  • Server Management
  • Network Configuration
  • Web Hosting
logo

Posts by Steve Martin