0

I just took over a bunch of old WordPress sites that have no child themes. The sites are heavily customized and not just in the styles.css file. Header.php, functions.php are all suspected to be modified. My best idea so far is to copy all the suspected files into the child theme file, but I haven't been able to find any well documented way of how to do this. I want to make sure I get these sites up to date and don't break them.

2
  • 1
    Try using a online tool to compare files against a fresh download of the parent theme. Jul 10, 2015 at 16:05
  • Very true, a lot of work though due to the magnitude of sites that have this problem. Thanks man! I hope there's an easier way but that helps!
    – cameck
    Jul 10, 2015 at 17:01

1 Answer 1

0

I wrote a script called wp-diff you can use on the command line to implement the comparison step Brad Dalton mentioned.

If you have many sites, a command line tool is far faster to use + can get to all your WordPress install files, with no requirement to change the Apache (or other server) config. Usually Web servers are configured to block access to .php files inside WordPress installs that should only be used by WordPress + should be hidden from the outside world.

First step is knowing if any WordPress core files have been changed.

Second step (command line again) is doing a 'diff -r' between a pristine copy of a theme (like twenty fifteen) + the theme being used.

I have a new client with 20-30 sites where someone foolishly made extensive modifications to twenty thirteen.

With these sites, I'm having to do what you're doing.

1) find differences

2) move differences into child theme

3) switch back + forth between old hacked theme + pristine theme + child theme pair, to ensure all functionality is correct

I don't see a way to attach a copy of my wp-diff script. If you'd like a copy, goole me + find my Skype ID + send me an add contact with a message that you're requesting a copy of wp-diff.

3
  • 1
    How long is that script? You can insert is a code in your question or, if it is too long, add a link to a gist.
    – fuxia
    Jul 11, 2015 at 12:37
  • Wow, that's really cool man!
    – cameck
    Jul 12, 2015 at 15:58
  • 47 lines long. Dirt simple. Jul 13, 2015 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.