WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] grep for WordPress? (5 posts)

  1. nycvelo
    Member
    Posted 5 years ago #

    Greetings. Is there a grep-like command to find text strings in WP posts?

    I am looking to convert table references in WP posts from the old WP-Tables to Tobias' excellent WP-Tables-Reloaded plugin. The first task is to find all the existing WP-Tables references. I am aware that the WPT and WTR IDs are different but conversion is the easy part; first I need to find the WPT references.

    This is on WP 2.8.3. I am the sysadmin for the system WP runs on.

    Thanks in advance for any clues on text searching.

  2. TobiasBg
    Member
    Posted 5 years ago #

    Hi,

    I don't know of an easy way to do this, but I suggest the following, as you will most probably have to touch each post/page with a table individually, because the ID of the table changed:

    Just use the search on the "Edit" screen of the "Posts" and "Pages" screens of WordPress. If you search for "[TABLE " you should get only those tables with a wp-Table in them. Then you could edit each of those one by one, replacing the old shortcode with the new one.

    This requires some manual work, but it's the only way I see for achieving this.

    Best wishes!
    Tobias

  3. willkemp
    Member
    Posted 5 years ago #

    You could try google! A search string like:

    site:your.site.net "the text string you're searching for"

    might do it.

  4. willkemp
    Member
    Posted 5 years ago #

    Alternatively, if you feel like descending in the dark realms of mysql, you could try something like the following mysql query:

    select ID from wp_posts where post_content like '%your search string%';

    It's a bit clunky, but it might work. If it does, it will give you the post IDs. If you'd rather have the post titles, you could do:

    select post_title from wp_posts where post_content like '%your search string%';
  5. nycvelo
    Member
    Posted 5 years ago #

    Thanks! These are both great suggestions. I didn't know content was searchable through the WP dashboard, nor was I aware of the 'like' keyword in SQL.

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic