Title: Custom string generated based on page title
Last modified: August 19, 2016

---

# Custom string generated based on page title

 *  Resolved [ADBL](https://wordpress.org/support/users/adbl/)
 * (@adbl)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/custom-string-generated-based-on-page-title/)
 * Hi —
 * On selected pages, I would need something that would add links based on page 
   title words.
 * For example, the page would be titled “Erich von Stroheim” and it would generate:
 * `More about Erich von Stroheim : <a href="http://www.google.com/images?um=1&hl
   =fr&safe=off&q=%22Erich+von+Stroheim%22">Google Images</a> • <a href="http://
   imdb.com/find?Erich+von+Stroheim">IMDb</a> • etc...`
 * I’m doing this for a very inexperienced user, so I would ideally avoid having
   to fill in custom links. This could be based on tags if there is a plugin that
   adds page title as tags.
 * TIA.

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

 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/custom-string-generated-based-on-page-title/#post-1525217)
 * Have you looked at using this function in your links:
    [http://codex.wordpress.org/Template_Tags/the_title_attribute](http://codex.wordpress.org/Template_Tags/the_title_attribute)
 * For example:
 *     ```
       <?php $title_search = str_replace( " ", "+" , the_title_attribute('echo=0') ); ?>
       <a href="http://imdb.com/find?<?php echo $title_search; ?>"><br />IMDb</a>
       ```
   
 *  Thread Starter [ADBL](https://wordpress.org/support/users/adbl/)
 * (@adbl)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/custom-string-generated-based-on-page-title/#post-1525226)
 * Yes, I found out about this as you were typing it seems.
 * Now I’m using this kind of code :
 *     ```
       <a href="http://www.variety.com/search/siteall?q=<?php the_title(); ?>&x=0&y=0&s=date" target="_blank">Variety</a>
       ```
   
 * ..and will try to implement your wya of adding “+” signs.
 * The only problem I’m left with is that on some site (e.g. Variety), accented 
   characters are breaking the search, e.g.
 * [http://www.variety.com/search/siteall?q=amélie&x=0&y=0&s=date](http://www.variety.com/search/siteall?q=amélie&x=0&y=0&s=date)
   
   vs. [http://www.variety.com/search/siteall?q=amelie&x=0&y=0&s=date](http://www.variety.com/search/siteall?q=amelie&x=0&y=0&s=date)
 * So I need to find a way to convert accented to plain characters from the_title…
 * Off looking this up in the forums, maybe I’ll post a new thred if needed.
 * Many thanks anyway.
 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/custom-string-generated-based-on-page-title/#post-1525285)
 * It looks like there may be a bit of trial and error finding the most correct “
   separator” as well as how best to handle letters that have accents … I would 
   refer to the documentation at [php.net for strings](http://www.php.net/manual/en/ref.strings.php)
 *  Thread Starter [ADBL](https://wordpress.org/support/users/adbl/)
 * (@adbl)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/custom-string-generated-based-on-page-title/#post-1525331)
 * I found `<?php remove_accents(the_title()) ; ?>` and it works!
    Thanks for your
   answers.
 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/custom-string-generated-based-on-page-title/#post-1525334)
 * I love how there are all these little gems in the WordPress functions … [http://codex.wordpress.org/Function_Reference/remove_accents](http://codex.wordpress.org/Function_Reference/remove_accents)
 * Glad I could help.
 *  Thread Starter [ADBL](https://wordpress.org/support/users/adbl/)
 * (@adbl)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/custom-string-generated-based-on-page-title/#post-1525375)
 * Actually this turned out to not work somehoh…
 * THIS does:
 *     ```
       <?php echo remove_accents(the_title('','',false)) ; ?>
       ```
   

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

The topic ‘Custom string generated based on page title’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [ADBL](https://wordpress.org/support/users/adbl/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/custom-string-generated-based-on-page-title/#post-1525375)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
