Yes, you can remove the form from the index and the excerpts. How is the form added to the page? Is it a shortcode, or just directly on the page? What does the page look like in the database? (You can see that from the Relevanssi debugging page.)
Thanks for the fast response! I had to look it up as I didn’t add that form, but it appears to be a Mailchimp form pasted in as a custom HTML block. So if I need to add a class or ID to the form, I can do that.
Adding the class relevanssi_noindex to the block will remove it from the index. It doesn’t remove it from the excerpts, but since the post cannot be found with the block contents anymore, that’s a smaller problem.
If necessary, you can use the relevanssi_pre_excerpt_content hook to remove the form block from the content before Relevanssi builds excerpts.
I was able to find the previous ticket on excluding by class at
Worked right off! So I have it at least rendering a decent excerpt now. I haven’t been able to figure out how to exclude from indexing based on a class name, so if there’s something you can point me to for that I would appreciate it. Thanks!
Funny I replied before I saw your second note — it’s still indexing that page, so it must be finding the word somewhere else, but the snippet I found did exclude the form contents from the excerpt. So, now it’s perfect 🙂
