An error occurred: Sorry, new users can only put 2 links in a post

An error occurred: Sorry, new users can only put 2 links in a post.

This is a joke? You let me add all my bug description and then you spit in my face the above message. I did not have links in my post. Shame!

The reason is spam protection. If you have error messages or similar, it’s best to wrap them in a code tag. This prevents URLs for downloads or similar content from being counted as links.

Yeah, it annoys myself whenever I face this limitation in other forums. And I often do reports along with links to code sections, commits, PRs etc.

However, if you operated a forum that does not make everything wrong about SEO/visibility, you’d quickly realize that those limits are not done to annoy users, but a necessity to stay in control of the constant spam bot activity.

You might have hit the limit due to plain text logs. Consequently wrap pasted logs, code etc into code fences:

```
logs/code here
```

It makes them better readable as well.

I fully understand the need to block spam. No objection here.
What I don’t understand is the fact that you are allowed to spend time editing the post and then, at the end, you are rejected without any concern for your effort. At least offer a local save option.

We don’t reject anything. This is a behaviour of Discourse. And you are able to encapsulate everything in code tags as already mentioned above. This will work around the link limitation

Isn’t the post preserved as draft, so that you can edit out the links right away?

I remember on the UrBackup forum, where I added 5 links in a post related to a packaging issue and fix I worked on. And the system (Discourse as well) flagged and hid that and all my prior 6 posts which contained any link across the forum retrospectively :sweat_smile:. But nothing was lost, I could edit that and all other hidden posts. Just needed to wait for Martin (UrBackup developer) to unhide them again.

OK, understood.

On the other hand you have to accept not everybody is familiar with the markup languages.
If you do support you have to get into the hide of the other guy who has the problem.
Example: you tell me “this is the behavior of Discourse”. What the heck is Discourse? Am I supposed to know about Discourse?
No offense guys. I appreciate Dietpi very much. I’m doing embedded and I’m a stranger to everything WEB related.
Please change the message “new users can only put 2 links in a post” with something everybody can grasp.

You are doing a great job with Dietpi. I was using raspbian before and I am delighted I found Dietpi. It is perfect for a small system
in the embedded world. Congratulations!

Discourse is a very popular community software platform https://www.discourse.org/

It is essentially an application (container) that we run on our server and which comes with everything we need. We can set the link limit for new users (currently 2), but we cannot change the error message.

Also isn’t the error message “new users can only put 2 links in a post” extremely clear? What would you suggest instead? A change could be suggested at their own forum (which is of course also a Discourse instance): https://meta.discourse.org/

I would suggest the same thing you told me to do: "Enclose your links (error messages) in code fences ".
Better, add an example.

The 2 links doesn’t tell me anything about how I can fix it. If Discourse is well done they will provide you with a hook on their error message so you can be more specific.

But that would not describe the limitation, and not the only way to address it. 2 real links are allowed, and the sane way to avoid a 3rd link varies. Wrapping URLs into code tags or fences is one workaround, if you must keep them in your post at all. The “Preformatted text” button to archive this is in the toolbar of the editor, using a standard icon. For logs/code this makes sense in any case, but not every forum is about software.

A hint to wrap logs/code with the preformatted text button below the existing error messages would make sense for software-related forums though. Actually it is a good hint for first posts in general, to make the pastes readable.

I found the error message in the translation files: discourse/config/locales/server.en.yml at 827f20a1a09e4c1503855b8c8dfcc9d94ae4701e · discourse/discourse · GitHub
Theoretically, if they are not baked into some compiled frontend file, we could patch them on container updates/rebuilds, just appending an English sentence to the string in every language :thinking:.

Found a way to change the tests in admin settings:

But this needs to be done for each and every language :disappointed_face:. Sadly no way to append or insert something into every language string at once.

This is in in “Site tests” in admin settings:

I added the same to the default English (UK) texts popping up during the first 2 topics and posts done by new users: