View Full Version : Mass remove external links
Xtrigit
11-26-2010, 01:52 PM
Is there a way I could mass delete external hyperlinks from posts?
Thanks
Danielgsc
06-20-2011, 11:28 AM
Anybody? I'm interesting too. Mass delete or delete the links from a subforum...
gobears20
11-13-2014, 05:15 PM
Anybody know of a way to do this?
I think you'd have to write php to do that. Someone more clever than I am might figure out how to do it with an sql statement, but I couldn't.
If you wanted to make certain forums so that urls couldn't be displayed, you might be able to do that by changing how the [url] bbcode is processed, and that owuld hide the existing ones as well as future ones. But that requires some programming as well.
I think you'd have to write php to do that. Someone more clever than I am might figure out how to do it with an sql statement, but I couldn't.
If you wanted to make certain forums so that urls couldn't be displayed, you might be able to do that by changing how the [url] bbcode is processed, and that owuld hide the existing ones as well as future ones. But that requires some programming as well.
It may be possible in a complicated SQL query which makes use of a regex, but even that exceeds my skills. I indeed think it's easier to do this in a PHP script which just iterates through all posts which contains the URL tag or links, then check on the domain and ignore whitelisted ones and finally remove the links.
gobears20
11-13-2014, 09:30 PM
Yeah apparently I have some bad links in posts but I have so many there is no way to track all posts down. I would probably either need to remove the links or rename the links to something else.
ozzy47
11-13-2014, 11:29 PM
Yeah it is not something that can easily be done. If you really want this, you should hire someone. But make sure you do a full backup before anyone starts working on this. :)
gobears20
11-14-2014, 12:00 AM
I hear that ozzy47, don't want to crash and burn like that :)
Do you know of anybody that does work like that company or a well known person?
ozzy47
11-14-2014, 12:01 AM
Best bet would be to post in the paid request forum, https://vborg.vbsupport.ru/forumdisplay.php?f=30
Make sure you read the sticky threads in there before hiring anyone. :)
gobears20
11-14-2014, 12:23 AM
Thanks:)
Hire at your own risk ;)
Here is what happen to me. I have a forum with over 4 million posts and AdSense says that some of my links are going to inappropriate sites. I have three days to get it corrected. Well I have no idea what links are good and what are bad because I have links to all kinds of sites from my posters. So I am stuck with either removing the adsense ads or creating a query that will either rename any links or delete the links. Not really the way to start off your morning seeing that at 6am this morning :) Its hard to watch every single posts on my site and to where its linking to.
ozzy47
11-14-2014, 12:30 AM
Is this because they are live links?
gobears20
11-14-2014, 12:38 AM
Yeah it started out the images so I turned that off but then they came back and found links that were going to bad sites.
ozzy47
11-14-2014, 12:45 AM
Ok first do a complete backup of the site.
Then go to ACP--> Settings --> Options --> BB Code Settings --> Enabled Built-in BB Codes set the Allow Link BBCode to no.
Then go to ACP --> Maintenance --> General Update Tools and run the Rebuild Post Cache
Now any links such as https://vborg.vbsupport.ru/showthread.php?t=254263 should show up like this, [url]https://vborg.vbsupport.ru/showthread.php?t=254263[/url]
Hopefully that will satisfy adsense, as you no longer have live links to sites. :)
gobears20
11-14-2014, 12:52 AM
Thanks for that info! If I do something like that and decide to turn it back on after that will the links from when people start posting links show up? I don't mind if the links show up after all of this its the back dated ones I want to show up without the link like you have above..
What I am thinking about doing is creating the backup site and using it as a test site to see what everything actually looks like :)
ozzy47
11-14-2014, 12:54 AM
If they post links after you do as I suggested, then turn it back on, sure it will show as a live link. As far as the old links, I am not totally sure, it is something that is not tested to any extent.
gobears20
11-14-2014, 12:59 AM
Thanks:)
I am actually surprised I don't see a mod for this because I can't be the only site that adsense is coming at about this. I hope this doesn't happen to anybody.
ozzy47
11-14-2014, 01:08 AM
I might have another solution. First do a full backup.
Then in phpmyadmin, run the following two queries:
UPDATE post SET pagetext = REPLACE(pagetext, 'https://vborg.vbsupport.ru/showthread.php?t=254263
This way the older links can not be made live again. :)
gobears20
11-14-2014, 01:22 AM
Thanks, I may end up doing that. :)
Some things I am noticing is that if you enter www or http it will automatically show as a link on my site. It’s almost like I would have to look for anything like http or www and replace. It would be kind of like breaking the links which in my case would not be a bad thing :). Some other things I have thought about was redirecting all links to a specific Website. I saw somebody post something about that.
ozzy47
11-14-2014, 01:25 AM
Yeah not sure about the other ways, but I think the way I described is going to be the simplest to do.
gobears20
11-14-2014, 01:27 AM
Thanks so much for your input! :)
ozzy47
11-14-2014, 01:29 AM
Not a problem, hopefully it will satisfy google. :)
Some things I am noticing is that if you enter www or http it will automatically show as a link on my site.
In that case I believe a ... gets inserted automatically.
ozzy47
11-14-2014, 09:12 AM
Correct, as the link bbcode does that. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.