Prevent form action from being followed by robots
Is there a way to prevent robots to follow form actions? I get errors like this:
Uncaught TYPO3 Exception: #1298012500: Required argument "form" is not set for Tx_Powermail_Controller_FormsController->create.
This cause robots try to follow this links via GET request.
I'm using the powermail extension and this will use the fluid ViewHelper f:form
. I tried to remove the action parameter, but this parameter will appear anyway.
Answer
You can't prevent malicious bots from trying to access that action. You can only hope to make friendly bots ignore it.
To do that, try to add the attribute to the form tag. It tells robots that you don't want the link to be followed. It would look like this in fluid:
<f:form [...] additionalAttributes="{rel: 'nofollow'}">...</f:form>
I'm not sure that it'll actually prevents bots from calling the action.
A (possibly not applicable) alternative way would be to add a <meta name="robots" content="index,nofollow"/>
to the pages <head>
. (Maybe replace index
with noindex
.)
Related Questions
- → How do I call the value from another backed page form and use it on a component in OctoberCms
- → Inline JS callback syntax Vs Internal JS callback syntax
- → Prevent form action from being followed by robots
- → How to remove parameters from the root URL if it does I18n
- → SEO Canonical URL in Greek characters
- → Htaccess negation
- → Wrapping anchor elements with text
- → Adding schema.org to site
- → dynamic php title depends on page id and using of "if (isset"
- → Building sitemap for 2 wordpress install under 1 domain
- → Bigcommerce Repeating url
- → 301 Redirection from no-www to www in wordpress
- → Wrapper inside or outside HTML5 semantics main, which is best practice?