• Resolved properpictures

    (@properpictures)


    Hello,

    I had this plug-in installed that places social media buttons in my posts. I recently removed that plug in becuase I wanted another one that suited me better. But the thing is, on every post it left a code-text behind like this: [sgmb id=”1″]

    It shows up on a lot of my posts. Is there a way to remove that from several posts at once? Or am I doomed to do this post by post?

    Thanks a lot for taking the time to read and answer.

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hello ther,

    Add this code to your theme’s functions.php file
    add_shortcode( 'sgmb ', '__return_false' );

    Hope it helps and let me know if you require any further assistance.

    Thread Starter properpictures

    (@properpictures)

    Thanks Poonam,

    I did put the code in the functions.php file. I tried at the end of the file and in the beginning, but no luck. Can it be that I have to add [sgmb id=”1″] in your code instead of only ‘sgmb’?

    Any other ideas? Really appreciate your help!

    Try to put
    add_shortcode( '[sgmb id=”1″]', '__return_false' )

    Thread Starter properpictures

    (@properpictures)

    Lol, that made my website disappear. Left me with a blanc page.
    Luckilly I was able to delete the code via ftp client 🙂

    Does it matter where I put the code in the functions.php?

    Oh sorry for that. No it doesn’t matter.
    One last time can you try this code
    add_shortcode( '[sgmb]', '__return_false' )

    Thread Starter properpictures

    (@properpictures)

    Hi Poonam,

    Same problem as the other one: my website disappears. Thanks for trying anyway!

    Sorry I forgot semicolon (;) that’s why your site disappeared.
    Try with semicolon
    add_shortcode( '[sgmb]', '__return_false' );
    or
    add_shortcode( '[sgmb id=”1″]', '__return_false' );
    If it is not work you can try this plugin
    https://wordpress.org/plugins/remove-orphan-shortcodes/

    Thread Starter properpictures

    (@properpictures)

    First one doesn’t work, second one made my website disappear! 🙂

    I will take a look at that plug in you recommended.

    Thanks for helping out!

    Thread Starter properpictures

    (@properpictures)

    Wow..still something went wrong. For some reason I can’t login anymore via wp-admin 🙁 I can see my site when i type the url, but when I want to log in I just type /wp-admin and log in. But now there is only a blanc page. Not even the log-in screen..Any ideas what went wrong? I adjusted the functions.php like it was before…I think.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    poonam’s approach is incorrect. That’s not how add_shortcode works.

    Install the plugin “better search and replace”. Use it to search the wp_posts table for [sgmb id="1"] and replace it with a single blank. (Backup your database first!)

    Thread Starter properpictures

    (@properpictures)

    Ok. Thanks. Only..atm I can’t log in so I don’t know how to solve this.

    Thanks anyway for the info!

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Remove the code you added to functions.php that broke your site. Use FTP or your hosting control panel to download the file. Edit it and re-upload. NEVER NEVER NEVER NEVER edit PHP files with appearance->editor.

    Thread Starter properpictures

    (@properpictures)

    Well..I did fix the functions.php. I hope I don’t accidently put an extra space or whatever..And your warning of not using appearance -> editor is noted, but too late 🙁

    Still can’t login. Site is visible, but after putting /wp-admin behind the url, I end up with a blanc page

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Errors like this are logged. Check the error log on your server. If you can’t find the log, please contact your host.

    Meantime, enable wp_debug and wp_debug_log and after an error, look at wp-content/debug.log to see if anything gets logged there. https://codex.wordpress.org/Debugging_in_WordPress

    Thread Starter properpictures

    (@properpictures)

    Ok, problem of white page solved by my hosting company. Now back tot the original problem 🙂

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Removing same text from several posts at once?’ is closed to new replies.