How to remove the Contact page safely

This is the right place to report general bugs, make suggestions or ask for help.
User avatar
WineMan
Posts: 107
Joined: Tue Sep 01, 2020 5:03 pm

Re: How to remove the Contact page safely

Post by WineMan » Fri Nov 17, 2023 8:27 pm

Thank you so much eagleman for your help on this. I had not seen this option before and now that I have, I am going to try to have all comments approved before being displayed...hopefully that will slow down the spam. If that doesn't stop it, I can always delete it as you have described.

User avatar
fraenkiman
Posts: 223
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: How to remove the Contact page safely

Post by fraenkiman » Fri Nov 17, 2023 8:29 pm

Hello WineMan,

The conversational variant is to simply activate the following option for the relevant posts: "Block comments: Do not allow comments for this post."
WineMan wrote: โ†‘Fri Nov 17, 2023 3:45 pm I've looked at the possibility of not allowing url's in the comments but can't figure out how to do that. Thanks.
To block URLs/comments that contain URLs, you can use the QuickSpamFilter plugin. You can try adding the following three to the banned words:

Code: Select all

www
http
https
The number of forbidden words must be 1.

Otherwise, the plugins Accessible Antispam and the "Comment check with Akismet" in the Comment Center also do a very good job.

With best regards
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

User avatar
WineMan
Posts: 107
Joined: Tue Sep 01, 2020 5:03 pm

Re: How to remove the Contact page safely

Post by WineMan » Fri Nov 17, 2023 8:42 pm

Thank you fraenkiman, I will try your QuickSpamFilter suggestion as well.

User avatar
WineMan
Posts: 107
Joined: Tue Sep 01, 2020 5:03 pm

Re: How to remove the Contact page safely

Post by WineMan » Wed Nov 22, 2023 12:11 am

With the help of a developer friend, this piece of code was added in comments.php file. In my case it was added beginning online 138

Code: Select all

if (preg_match("~href|http|[^\s\.]{2,10}\.[^\s\.]{2,30}\.[^\s\.]{2,10}~i",$content)) { //URL found (href | http | xxx.yyy.zzz))
		$errors ['content'] = 'URLs not allowed in comments - please remove it.';
	}
Seems to work if the spam commenter is there to add a URL.

User avatar
Arvid
FlatPress Coder
Posts: 576
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: How to remove the Contact page safely

Post by Arvid » Sun Dec 31, 2023 2:16 pm

Just a thought on that one: Please don't forget to add the snippet again after updating your FlatPress instance in the future.
Would fraenkiman's suggestion with the QuickSpamFilter plugin be the better way in terms of update safeness?

All the best,
Arvid

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests