How to prevent GPT from outputting responses in Markdown format?

Hello everyone,

I’m facing an issue with ChatGPT consistently delivering responses in Markdown, which is problematic for me because I use the generated text in a word processor for legal purposes.

I’ve tried several prompt engineering techniques, such as placing commands to remove Markdown at the beginning and end of the prompt, and using affirmative requests like “deliver the response in plain text with no formatting” or “give me the answer in pure text.” Unfortunately, none of these solutions have worked. GPT keeps generating responses in Markdown, and I’m left with the extra step of manually removing the formatting or asking ChatGPT again to clean the text from Markdown characters.

Does anyone have any advice or experience on how to permanently prevent ChatGPT from formatting outputs in Markdown? Any help would be appreciated, as this is adding unnecessary work to my process.

Thank you!

1 Like

Hi @rodrigomartinsfaria :wave:

Welcome :people_hugging: to the community!

A kindly reminding; when you ask, if you show some sample outputs from ChatGPT, it can help community members to understand problem better and provide better solution.

BTW, you may try some following prompts. I hope, one of them can help you.

1- Specific Formats
Alternative format explicitly, such as “raw text” or even “JSON format”.

  • Example prompt:

Please deliver the response in plain text without any Markdown or formatting. Provide the output as raw text.

  • Alternative prompt:

Respond in JSON format with a key ‘response’ containing the pure text, no Markdown, no special characters.

2- Structured Delimiters
We can use delimiters like """ or --- and provide clear instructions for ChatGPT to only generate plain text within these delimiters.

  • Example prompt:

Please deliver the following response inside triple quotes (""") and ensure there is no Markdown formatting, no special characters, and no extra spaces. Deliver the response as plain text within the quotes.

"""
Deliver the response here in plain text without any formatting.
"""

3- Role based
We can make the GPT adopt a role that explicitly avoids formatting. This technique can help establish a consistent tone:

  • Example prompt:

You are a legal assistant writing formal documents. Ensure the response is in plain text without any Markdown or special formatting. Avoid bullet points, asterisks, or any symbols that indicate structured text.

4- CoT (Chain-of-thought) prompt
We can guide ChatGPT step-by-step through the task of stripping Markdown:

  • Example prompt:

First, generate the response with Markdown formatting. Then, in the next step, remove all Markdown characters and symbols. Deliver only the pure text with no formatting in the final output.

5- Clarify What Constitutes “Plain Text”
Sometimes, specifying what we mean by plain text in the context of our document needs helps.

  • Example prompt:

Provide the response as plain text, which means: no bold, no italics, no headers, no bullet points, no links, no code blocks. Just words, without any special characters.

3 Likes

All of your outputs from now on should be formatted in plaintext (without markdown formatting), and inside of a plaintext code block.

Example:
```plaintext
<your response>
```

Hi @rodrigomartinsfaria !

I found that it still refuses to listen to formatting instructions sometimes when I provide them in the chat, so for me adding these instructions under “Personalization” worked much better.

So if you go to ChatGPT Settings (in Desktop app, or website), and then Personalization → Customize ChatGPT → “How would you like ChatGPT to respond?”, you can then include an instruction similar to what @nicholishen wrote.

Bonus with this method is that it will always behave like this from now on, in newly initiated chats, so you don’t have to keep telling it to not output Markdown.

I add output to codebox at the end of these types of prompts.