Title: Replace a string in content
Last modified: August 19, 2016

---

# Replace a string in content

 *  Resolved [phdimov](https://wordpress.org/support/users/phdimov/)
 * (@phdimov)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/replace-a-string-in-content/)
 * Hi,
 * I am trying yo write my first plugin where it will look in the content of a post
   for the {charts 1.xml} and replace with a javascript snippet
 *     ```
       <script type="text/javascript" src="swfobject.js"></script>
   
       	<div id="flashcontent">
       		<strong>You need to upgrade your Flash Player</strong>
       	</div>
       	<script type="text/javascript">
       		// <![CDATA[
       		var so = new SWFObject("tock.swf", "stock", "800", "400", "8", "#F9F9F9");
       		so.addVariable("path", "");
       		so.addVariable("settings_file", encodeURIComponent("1.xml"));
               so.addVariable("preloader_color", "#999999");
       		so.write("flashcontent");
       		// ]]>
       	</script>
       ```
   
 * I know how to replace {chart} into what I need but I can’t think of the best 
   way to replace {chart 1.xml} where I can put whatever file I want.
 * Thanks for any advice in advance

The topic ‘Replace a string in content’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [phdimov](https://wordpress.org/support/users/phdimov/)
 * Last activity: [15 years, 5 months ago](https://wordpress.org/support/topic/replace-a-string-in-content/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
