Use WordPress CMS as a File Comparator

The Story:

Compare Files with WordPressStudioPress just rolled out new versions of their Lifestyle and Church themes. This is not an update to the current versions, but totally new themes. There is not quick update available, so if you have customized your current theme, you have to do it all over again.

I have some clients who use these themes, and they wanted to new versions installed. Can’t blame them, new themes are SEO optimized by Yoast –what more do you need?

The Problem:

The old theme, had customizations like changes in color scheme, custom category pages and minor tweaks. It had been some time since I did that one, so I had forgot what all I did.

Starting from scratch is painful; eyes are not sharp enough to spot all changes. Brain thinks of an easier way.

The Clue:

See this image, it has a hint, if you get it, you can stop reading this post and continue working. Thanks for dropping in.

Text Files Compared using WP In-built comparator

Text Files Compared using WordPress In-built comparator

The Solution:

Click! Why didn’t I think of this before? WordPress has an inbuilt file comparing thingy – the same one we used to compare post revisions.

Using Inbuilt File Comparator of WordPress

I will use the above problem as an example. The task ahead is to customize an updated version of a file with the changes you had done earlier to an old version of the file.

– Open up the post editor to write a new post. Switch to html view.

Switch to HTML View

Switch to HTML View

– Copy-paste the old file with your customizations to the post editor. Save the draft.

– Overwrite this with the new non-customized file. Save the draft again.

– Scroll down to the end of the post editor where you will see “Post Revisions”. Click any of the revision.

See Post Revisions Towards the end of the Post Editor

See Post Revisions Towards the end of the Post Editor

– It will open up showing the revision you clicked on. Scroll to the end to see the revisions. Select the first and the last radio buttons, click “Compare Revisions” to see the magic.

Compare Revisions - Do as shown

Compare Revisions - Do as shown

– The files are shown side by side with the changes high-lighted.

Files Compared Side by Side - Differences Highlighted

Files Compared Side by Side - Differences Highlighted

Now you know exactly where all the edits are done, so its easier to go back and edit the new file. Problem solved!

Hello, I am Arun Basil Lal. Thank you for reading!

I am a WordPress product developer and creator of Image Attributes Pro. I am passionate about solving problems and travelling the world.

Divi WordPress Theme - My Review

Divi WordPress Theme
Divi is a WordPress theme that web designers do not want you to know. It comes with a drag-and-drop theme builder. You can build beautiful looking unique websites without touching a line of code. Just choose from one of the many pre-made layouts, or pick elements and arrange them any way you like.

Divi is every WordPress developer's wet dream. Surprise your clients with neat responsive websites and have fun building them.

Divi comes from Elegant Themes. If you enjoy building websites, you *need* an Elegant Themes membership. 87 beautiful themes and 5 plugins for the cost of less than a candy-bar each!


Note: I am an avid user of Divi myself and this is a honest review. I wouldn't recommend something that I do not personally find amazing.

14 Comments.

  1. Rishi says:

    This is awesome, Arun! So many times I’d be comparing my old stylesheets to current versions and had trouble remembering *all* the changes I made. Now I won’t. 😀

  2. Binny V A says:

    This is a very old problem for programmers. There are tools to do this for you – you can take changes from one file to other etc. easily using those programs. WinMerge seems like a good choice for Windows. I know of half a dozen of these programs for linux – but I don’t think that will help you.

  3. Amal Roy says:

    Great find dude. This is really gonna help me. This trick can be used for blogger templates too with my local host.

  4. muhabbet says:

    thankss for ur time.. very nice a post

  5. Nihar says:

    Thanks for this.

  6. Chat Business says:

    Good post Arun! Nice one

  7. DudeBroMan says:

    Our blogs share a lot in common. We should link to each other.

Leave a Reply to Binny V A Cancel reply

Your email address will not be published. Required fields are marked *

*