Announcement

Collapse
No announcement yet.

Mass edit thread titles

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mass edit thread titles

    Hi,

    Is there a quick way to mass edit a batch of post/thread titles and remove a single word.

    Regards

  • #2
    Run these queries (backup first):

    UPDATE post
    SET title = REPLACE(title, 'badword', '')

    UPDATE thread
    SET title = REPLACE(title, 'badword', '')

    Comment


    • #3
      Thanks Jake.

      Comment


      • #4
        How does that remove a word from the title and how does it know what the word is?

        As far as I can see it, that replaces all the title and not remove the word I need removing.

        Comment


        • #5
          > REPLACE(title, 'badword', '')

          REPLACE() is a MySQL function. This function call will replace the badword in the title field with the new string (empty in this case). For example, if the title is this:

          blah blah badword blah

          Then the REPLACE() function would return this:

          blah blah blah

          Comment


          • #6
            I dont want to replace, I want to remove and each thread title is different but each one has a word I want to remove.

            As an example:

            MIK3Y Intro
            scooby Intro
            cornishman Intro

            Each title above is a thread of its own but I want to remove the word intro from all of them.

            Regards and thanks.

            Comment


            • #7
              I've tried

              UPDATE thread
              SET title = DELETE(title, 'intro', '')


              Didn't work.

              Comment


              • #8
                You changed the query. Don't use DELETE. Use REPLACE.

                Comment


                • #9
                  But am I right in thinking thats replacing the whole thread title and not just removing the single word?

                  Regards

                  Comment


                  • #10
                    It did work, thanks.

                    UPDATE thread
                    SET title = REPLACE(title, 'Intro', '')

                    Regards.

                    Comment


                    • #11
                      Excuse me but where exactly do I enter these strings and how do I replace text in posts instead of titles?

                      Comment


                      • #12
                        Use this query:

                        UPDATE post
                        SET pagetext = REPLACE(pagetext, 'OLD TEXT', 'NEW TEXT')

                        You can run queries in your:

                        Admin CP -> Maintenance -> Execute SQL Query

                        You must have permission to execute queries in your includes/config.php file:

                        Code:
                        	//	****** USERS WITH QUERY RUNNING PERMISSIONS ******
                        	//	The users specified here will be allowed to run queries from the control panel.
                        	//	See the above entries for more information on the format.
                        	//	Please note that the ability to run queries is quite powerful. You may wish
                        	//	to remove all user IDs from this list for security reasons.
                        $config['SpecialUsers']['canrunqueries'] = '';

                        Comment


                        • #13
                          Thanks a lot, very useful.

                          If I want to replace jpg with gif images, what symbol do I use as wildcard?

                          FIND: <img src="/images/?.jpg">

                          REPLACE: <img src="/images/?.gif">


                          I thought it was % but didn't work, same with *.

                          Comment


                          • #14
                            Anyone?

                            Comment


                            • #15
                              UPDATE post
                              SET pagetext = REPLACE(pagetext, '.jpg', '.gif')

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X