Site logo

Archived topic

Changing the author name in json-ld

3 replies · Started by Ash on December 5, 2022

Viewing posts 1–4 of 4

Is this the json-ld inserted by GP?
<script id="generate-a11y">

I would like to change the author name for site security.
Is there a filter hook for it?

Hi Ash,

Yes, it's added by GP. There's a filter hook to filter if it should be added or not. But there's no filter to modify it.

See here: https://github.com/tomusborne/generatepress/blob/4895a2e7595bb809075b375201fd735112f41570/inc/general.php#:~:text=%27%3Cscript%20id%3D%22generate%2Da11y%22%3E%25s%3C/script%3E%27%2C

There filter hook is: generate_print_a11y_script.

What you can do is use this filter to not add/disable the script, and then hook your own modified script instead.

Thank you

You're welcome, Ash!

This archived topic is closed to new replies.