WordPress 7.1.2: critical core security fix. Update now, then check inactive themes and comments.

Details

Security tests

Update functions.php

How to edit a child theme functions.php safely when Security Ninja asks you to add code.

When a security test or fix asks you to change functions.php, edit the child theme file, not the parent theme.

Why the child theme

  • Parent theme updates overwrite functions.php changes.
  • Declaring the same function in both parent and child theme can cause a fatal “function already exists” error, because WordPress loads both.

If you do not have a child theme yet, create one before you add custom code.

Steps

  1. Connect via FTP, SFTP, or your host file manager (FTP guide).
  2. Open wp-content/themes/ and find your child theme folder.
  3. Edit functions.php in that folder.
  4. Add only the snippet the docs or plugin instruct you to add.
  5. Save, then reload the site and re-run the relevant security test.

Prefer a child theme or a small custom plugin for permanent snippets. Avoid editing parent theme files on a live site without a backup.

Still stuck? Get help or contact us.

Larger screenshot

Enlarged image