I have a WordPress website and I want to add PHP Script for a custom field, I am confused about adding it into index file, would it work or not or should I choose managed hosting for WordPress where the scripts can be added through the managed platform?

    Pending any WordPress experts jumping in here (I haven't really done anything with it in years), my one reservation about directly editing a WordPress file would be if you do any WordPress (or relevant plug-in) version updates and they overwrite your changes.

    Not an expert either, but Nogdog's observation is correct; for this reason what you're wanting to do would be created as a WordPress plugin that attaches to an action hook or a filter hook inside Wordpress.

    The plugin handbook is here.

      Write a Reply...