• A basic question…

    If I edit the header.php outside WordPress (ftp + text editor). Will the modified code be untouched then or may it be overwritten by future theme- or WP updates?

    Best regards,

    /LS

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    In WordPress, theme update actually means WordPress deleting the theme on your website and replace it with a fresh copy from the server.

    Theme update is not merging files.

    If you need customization, you should do it in a child theme.
    https://codex.wordpress.org/Child_Themes

    Thank you

    Thread Starter lensv

    (@lensv)

    So, what you are saying is that all edited code outside WordPress will be deleted by any update. Is that correct?

    Hi,

    I don’t think you understand what’s FTP.
    If you use FTP to edit the theme on your website.
    It’s the same copy of theme that’s install on your website.
    It’s the same copy of theme you see from your WordPress admin.

    There is no outside or inside…

    As long as the theme is run by WordPress, theme update will delete it and replace with copy from WordPress.org server..

    Thank you.

    Thread Starter lensv

    (@lensv)

    No, I don’t think that you understand what I actually mean. Let me clarify… If I use an integrated editor (e.g. one that comes with a theme or a plugin) the modified code is made “inside” WordPress and it will definitely stay untouched after an update, but if I use my own editor and upload the code by ftp I consider it “outside” WordPress.

    So I rephrase my question – Will all edited code be overwritten by future updates if it isn’t made within WordPress?

    Jason King

    (@jasoncharlesstuartking)

    If you edit the code of a theme or plugin, regardless of method, it will be over-written by the next update to that theme or plugin.

    That’s the case whether you use FTP or use Dashboard > Appearance > Editor or use the File Manager in the hosting control panel.

    Which is why you should always create a child theme and edit that, not the original theme, as per Denzel’s advice.

    I don’t know what you mean by an “integrated editor” because neither plugins nor themes come with their way to edit their code.

    Perhaps you are referring to the Dashboard > Appearance > Customize options. In which case, using this DOES NOT actually edit files. And those changes do not get wiped out when you upgrade plugins/themes, because those options are stored in the database.

    Thread Starter lensv

    (@lensv)

    Yes, maybe I was unclear when I wrote “edit”. It may very well be additions to the code that is made by these “integrated editors”.

    I guess that my original question is answered then… All edited (or added) code outside WordPress be deleted/overwritten by any update, right?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Edit HTML’ is closed to new replies.