I want to be able to show something like:

function foo()
    return "bar";

Is there a plugin?

I installed one called Code Markup, but this doesn't add any code options when I am adding a new post (at least not that I am seeing).


3 Answers 3


I use the SyntaxHighlighter plugin. It works well, is simple to use, and supports a good variety of languages.

See an article on my site for example output.


No need for a plugin.

All WordPress Setups come with this option available (unless you change the default setup).

Just enclose it as follows:

<code>function foo()
    return "bar";

You can find it below.

Where is the code ?


Suppose I have a code written using Ruby.

In my blog post I would do

[sourcecode language="ruby"]
def hello
  puts "Hi! This is Rohit here"

WordPress has this as a default feature. I haven't used any plugin for this.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.