title: Conditional insert text into field
body: <p>I 'me newbee and i have a test website in localhost. The database is "wp_test" and there is a table "wp_posts" (wordpress table) and i like to check the field "post_content" for the existing text <code>"&lt;link itemprop&gt;"</code> AFTER the text <code>"&lt;div class='easyrecipe&gt;"</code>. If this text not exists, then i insert the text link "my image" to all those records from that table.</p>
  
  <p>My goal is to check for images inside the posts and if add new to all posts that this missing.</p>
  
  <p>As i mention before i 'me newbee and because i've already check many posts about conditional text insert and i didn't find anything fits to my problem, i don't know even how to start coding like this conditional situation.
  EDIT: I 've check this mysql code and it show me all the appropriate records</p>
  
  <pre><code>SELECT * FROM `wp_posts` WHERE post_content LIKE '%&lt;link itemprop%'
  </code></pre>
  
  <p>Now all i want is to check for the following pseudo-code condition:</p>
  
  <p><code>If TEXT "&lt;link itemprop" NOT EXISTS THEN INSERT text "my image" AFTER TEXT "&lt;div class="easyrecipe"&gt;</code></p>
  
  <p>This is a part of the text inside "post_content" field</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="easyrecipe" data-rating="0"&gt;  &lt;link itemprop="image" href="http://www.greekouzina.gr/wp-content/uploads/2014/01/%CE%BA%CE%BF%CF%84%CE%BF%CF%83%CE%B1%CE%BB%CE%B1%CF%84%CE%B1-%CE%B3%CE%BB%CF%85%CE%BA%CE%BF%CE%BE%CE%B9%CE%BD%CE%B7.jpg" /&gt;
  &lt;div class="item ERName"&gt;κοτοσαλάτα γλυκόξινη&lt;/div&gt;
  &lt;div class="ERClear"&gt;&lt;/div&gt;
  &lt;div class="ERHead"&gt;Author: &lt;span class="author"&gt;Aggela&lt;/span&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Any help will be appreciated</p>