Title: How to change source code before rendering it
Last modified: April 9, 2022

---

# How to change source code before rendering it

 *  [online0227](https://wordpress.org/support/users/online0227/)
 * (@online0227)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/how-to-change-source-code-before-rendering-it/)
 * Hello, I want to use jquery to change some html tags before WordPress backend
   finally shows it through “view page source” feature of Chrome web browser.
 * I want to do it to alter SEO behavior so that schema.org always follow og:image
   if they are not pointing to same image right before showing entire source code
   to Google crawl bot.
 * Is this possible using jquery? or should I do it using php programming?
    What
   wordpress hook can grab entire html source code before showing it to clients?
    -  This topic was modified 4 years, 2 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

Viewing 1 replies (of 1 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/how-to-change-source-code-before-rendering-it/#post-15541765)
 * Changing the source code via jQuery will do little in terms of machine reading
   since the machines won’t run jQuery in the first place. Your example with og:
   image is only relevant for social media because it belongs to the OpenGraph format,
   which is used by Facebook or twitter to generate previews of links. If you want
   to remove this, better remove the plugin that integrates this information because
   it is not WordPress standard.
 * If you still want to manipulate the HTML code, you could try output buffering.
   An example can be found here: [https://stackoverflow.com/questions/70671148/is-there-a-hook-in-wordpress-that-i-can-use-to-filter-the-output-of-a-specific-s](https://stackoverflow.com/questions/70671148/is-there-a-hook-in-wordpress-that-i-can-use-to-filter-the-output-of-a-specific-s)

Viewing 1 replies (of 1 total)

The topic ‘How to change source code before rendering it’ is closed to new replies.

## Tags

 * [hook](https://wordpress.org/support/topic-tag/hook/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [threadi](https://wordpress.org/support/users/threadi/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/how-to-change-source-code-before-rendering-it/#post-15541765)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
