vivi
vivi

Reputation: 37

is posible in wordpress post to replace a single word

I have on idea but i dont know if that is posible eg. I'm writing a post in Wordpress site and I have to write a word too many times, is possible to write it once at the start and in the other part it to be written automatically by a shortcut or do I need a plugin. So if I change that word at the start all the other similar words to be changed automatically, like in word document action find and replace.

Upvotes: 0

Views: 104

Answers (2)

Evan Volgas
Evan Volgas

Reputation: 2911

You could write a shortcode, like brasoflio said, or you could just do exactly what you were thinking about in Word.... just do a find and replace in your document. Write the document in a text or markdown editor. Replace all instances of {abcdefg} with whatever text you want. Alternatively, you could use a find and replace plugin, or even write your own shortcode. But for something like this, I'd err on the side of laziness. Just write your text in a text editor, find and replace, then copy it in

Upvotes: 0

brasofilo
brasofilo

Reputation: 26075

Yes, you can use a Shortcode for that. And you can write your own mini-plugin to do it.

The plugin would be simply:

<?php
/**
 * Plugin Name: Single Word Shortcode 
 */

add_shortcode( 'so', 'shortcode_so_22482571' );

function shortcode_so_22482571( $atts )
{
    return "<a href='http://stackoverflow.com'>Stack Overflow</a>";
}

After activation, all [so] occurrences in your posts and pages will be converted to the Stack Overflow link.

Upvotes: 2

Related Questions