Wordpress - Remove Keywords?

Discussion in 'Web Design and Development' started by Aperture, Dec 7, 2008.

  1. Aperture macrumors 68000

    Aperture

    Joined:
    Mar 19, 2006
    Location:
    PA
    #1
    Hi Everyone, I have a setup that will allow me to post to my Wordpress blog via phone. When the phone call is transcribed and posted to my Wordpress blog, it has a signature that says "Powered by Jott."

    Is there any way that I can configure Wordpress to automatically look for that keyword and exclude it from the post?

    Thanks
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    I'd need more info. You might be able to extract that snippet when the post is created, but that may mean editing some code that's a little deeper in WordPress. Are you wanting to delete out that sig completely, or just hide it visually, or something else?

    You could do a string replace with PHP like so,
    PHP:
    $thePostText str_replace('Powered by Jott.'''$thePostText);
    This would be wherever in the code the post text is being processed. I haven't used WordPress so not sure how to help there.
     
  3. wesg macrumors regular

    wesg

    Joined:
    Jan 2, 2008
    Location:
    Toronto, ON
    #3
    What you're looking to do can be easily done with a Wordpress plugin. If you go to http://codex.wordpress.org/Plugin_API#Example and go down to Create a Filter Function you can create your own.

    In fact, here is an entire PHP file that should do the job. Just save this as removejott.php or similar in your plugin folder and give it a try.

    PHP:
    <?php
    /*
    Plugin Name: Remove Jott
    Plugin URI: http://www.macrumors.com
    Description: Remove the Jott signature
    Author: Someone special
    Version: 1.0
    Author URI: http://www.macrumors.com
    */

    function remove_jott($arg) {
        
    $arg str_replace('Powered by Jott'''$arg);
        
        return 
    $arg;
    }

    add_filter('the_content''remove_jott');
    ?>
     

Share This Page