Title: Replacing specific text with something else using JQuery.
Last modified: November 10, 2023

---

# Replacing specific text with something else using JQuery.

 *  Resolved [michalrama](https://wordpress.org/support/users/michalrama/)
 * (@michalrama)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/replacing-specific-text-with-something-else-using-jquery/)
 * Hello,
 * This is more of a code level question. I need to replace specific text.
 * It is the same on all pages, it is a **<span>** element and its parent element**
   <a>** always has the same URL. It could certainly be used to easily find this
   element.
 * How can I do this easily using JQuery please?
 * Thank you

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/replacing-specific-text-with-something-else-using-jquery/#post-17192377)
 * Something like:
    `$('a[href="https://example.com"] span').html("my new content");`(
   untested)
 * It’d be a lot easier if the span element had a unique identifying class name.
 * Having jQuery search through content for something in particular isn’t very efficient.
   Ideally the correct content would have been saved to start with. It’d be better
   to do a search and replace in the DB once than to do it every time a page is 
   served.
 *  Thread Starter [michalrama](https://wordpress.org/support/users/michalrama/)
 * (@michalrama)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/replacing-specific-text-with-something-else-using-jquery/#post-17198659)
 * Hello [@bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Thank you. It works. To be precise, these are breadcrumbs that are generated 
   by the theme itself.
 * And the home page is showing as **HOME** not **DOMŮ**.
 * So thanks again, this code works, but still I wrote to the [theme support](https://wordpress.org/support/topic/change-home-screen-language-for-breadcrumbs/)
   if it is possible to generate it directly in the correct language.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Replacing specific text with something else using JQuery.’ is closed 
to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [text](https://wordpress.org/support/topic-tag/text/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [michalrama](https://wordpress.org/support/users/michalrama/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/replacing-specific-text-with-something-else-using-jquery/#post-17198659)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
