Category
5 min read

Danger Move: Manually Editing Your Theme Code Can Crash Your Shopify Store

Published on
December 27, 2023

We understand the joy of perfecting the appearance of your Shopify store. Modern themes can enhance its appeal to customers, build trust, and boost sales. However, our extensive experience has shown that mistakes in theme editing are common causes of website malfunctions and crashes. Over the years, we have encountered numerous clients who have approached us with a common question: “How can I restore the previous version of my store that was working?” While we were able to assist many of them, unfortunately, some were not able to recover their website due to the lack of backups.

Even the smallest error in your code can have unexpected consequences, resulting in thousands of dollars in losses if left unaddressed. A single incorrect character in the code can bring your website to a complete halt. Let us share a use-case with you about a Shopify business owner who lost revenue every minute they spent admiring their new, beautiful store theme.

How the Bright Spring Theme Almost Broke the Sales Scheme

May was super excited about the upcoming spring sale on her online furniture and decor store. To ensure everything was perfect, she hired a freelancer to give her website a fresh seasonal look.

At first, the store’s theme with the new bright design elements looked flawless. Unfortunately, a day after the launch, May noticed a significant decrease in sales and received numerous complaints from frustrated customers.

Upon investigating, May discovered that an error message appeared when customers tried to add items to their cart. The “Add to Cart” button wasn’t working, and clicking on the cart icon led to no action.

May reached out to the freelancer for help. However, the freelancer couldn’t replicate the problem and insisted that everything was working correctly. Left to resolve the issue herself, May used different devices and web browsers. She discovered that she could buy items on her iPhone, but not on her Macbook or a Windows computer. Adding to her frustration, the freelancer was taking 4-8 hours to respond to her messages.

Unable to fix the problem herself, May found herself losing more clients, leading to a decline in income. With the spring sale imminent, she grew increasingly concerned. As much as she loved the new spring accents on her site, the theme wasn’t functioning properly, and she had to forgo them – at least for the time being. Fortunately, she had a backup in place that allowed her to roll back only the assets related to the theme design.

What Happened to May and How to Avoid It in Your Own Store?

The issue with the theme almost breaking May’s sales can happen to any online store. It's essential to understand that any changes to the website’s code, including a theme update or design overhaul, can cause problems affecting the site’s functionality. The errors and bugs that may arise after editing code are numerous and diverse, making them impossible to address in this article. In our case, an error in the code caused the “Add to Cart” button to stop working, preventing customers from making purchases.

May’s problem was exacerbated by the freelancer’s unavailability to address the issue promptly. This underscores the importance of having a reliable and responsive support system, especially during crucial periods like sales events. Fortunately, the Shopify community offers many ways to get help from experienced experts.

Additionally, testing the website’s functionality after any changes is crucial to prevent such issues. May could have avoided the problem with thorough testing. It's also vital to have a backup in place to protect against unforeseen issues. In this case, May’s backup allowed her to restore the theme design assets without losing any data.

Remember the Basics When Changing the Code:

  • Be Cautious: Make changes carefully. Even small mistakes in the code can significantly impact your site’s performance.
  • Duplicate and Back Up: Always duplicate and back up your theme before making any changes. This provides a safety net if anything goes wrong.
  • Test: Thoroughly test your store after changes to ensure everything functions correctly. Check all aspects, including links, buttons, and forms.
  • Get Support: If you encounter issues or are unsure about changes, seek help from the theme’s developers, Shopify experts, or support forums. This can save time and prevent damaging mistakes.

Some Practical Advice to Protect Your Store When Manually Editing Theme Code

The success of an online retail business hinges on its functionality and user experience. Yet, coding issues pose a significant threat, jeopardizing customer base, revenue, and overall success. Unsafe themes and customizations are common culprits, but practical steps can avoid them.

Choose a Safe Theme for Your Store:

  • Stick to Official Shopify Themes: Use themes from Shopify and its certified partners, found in the Shopify Theme Store. These themes are tested and approved by Shopify’s security team.
  • Utilize Shopify Support: If you’re using a free Shopify theme on the Basic plan or higher, you can get up to 60 minutes of complimentary design support.
  • Evaluate the Theme Developer: Research third-party theme developers thoroughly. Look for reviews, ratings, and a professional, trustworthy website. Confirm they provide customer support.
  • Check for Updates: Regularly updated themes often include bug fixes and improvements.
  • Avoid Nulled Themes: Nulled themes are pirated and can contain malicious code. Always use legitimate themes to protect your website and customer data.

Customize Your Store Theme Safely:

1. Duplicate the Theme: Before making changes, duplicate your theme to prevent data loss:

  • Go to the Online Store tab in your Shopify admin panel.
  • Select the current theme, then click on Actions and choose Duplicate.
  • The duplicated theme will be saved in the Theme Library.

2. Review Shopify Design Policy: Ensure your design plans align with Shopify’s Design Policy.

3. Use the Shopify Design Forum: A valuable resource for guidance on HTML, CSS, or Liquid customizations.

4. Employ Shopify’s Built-In Theme Editor: This tool allows for visual changes without needing custom coding.

5. Backup Your Theme: Use a comprehensive backup solution, like BackupMaster, to enable theme asset restoration separately.

6. Test on a Staging Site: Test changes on a staging site, an exact replica of your live site, to avoid impacting your live site.

7. Test Across Platforms and Devices: Ensure functionality on various browsers and devices.

8. Seek Shopify Experts: They offer extensive knowledge in creating, updating, and optimizing Shopify themes.

Why It Is Critical to Duplicate and Back Up Your Theme

Backing up your theme is crucial in any customization process. Changes, no matter how small, can break your website. This can range from adding new code to updating your theme or altering a button's color. Mistakes can occur even for experienced developers and might only be discovered after implementation.

Not having a backup can lead to the loss of all your previous customizations. By backing up your theme, you protect yourself and ensure a safety net in case of errors.

To back up your theme:

  • Go to Online Store, then Themes in your Shopify admin panel.
  • Locate and download your theme.
  • The theme will be emailed as a .zip file to the email associated with your staff login.

Conclusion

This article emphasizes that even minor errors in code can lead to significant malfunctions on your website. While many ways exist to detect and prevent such errors, taking code editing seriously and employing all possible measures is essential to maintain customer experience and income. Remember, backup is your last line of defense, but there are other steps to be aware of to ensure the smooth operation of your Shopify store.

Share this post
Alex Tchórzewski
Customer Engagement and Security Manager, BackupMaster