Pastacode
by Willy Bahuaud 4.9 (14 reviews)

Pastacode

Use Pastacode to add code into your posts with the awesome PrismJs coloration library. So, past'a code!

Tested up to WP 6.1 (Current: 6.9)
v3.0.1 Current Version v3.0.1
Updated 3 years ago Last Update on 24 Nov, 2022
Synced 8 hours ago Last Synced on
Rank
#9,359
-6 this week
Active Installs
500+
-7.7%
KW Avg Position
15
No change
Downloads
24.8K
+2 today
Support Resolved
0%
No change
Rating
98%
Review 4.9 out of 5
4.9 (14 reviews)

Next Milestone 600

Total Progress 31%
500+ 600+
440
Ranks to Climb
-
Growth Needed
8,000,000
Active Installs
Pro

Unlock Exact Install Count

See the precise estimated active installs for this plugin, calculated from real-time ranking data.

  • Exact install estimates within tiers
  • Track install growth over time
  • Milestone progress predictions
Upgrade to Pro
Need 69 more installs to reach 600+

Rank Changes

8,883 9,119 9,355 9,591 9,827 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
9,316 9,328 9,341 9,353 9,365 05-01-2026 06-01-2026 07-01-2026 08-01-2026 09-01-2026 10-01-2026 11-01-2026 12-01-2026 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
9,299 9,316 9,333 9,350 9,367 21-12-2025 22-12-2025 23-12-2025 24-12-2025 25-12-2025 26-12-2025 27-12-2025 28-12-2025 29-12-2025 30-12-2025 31-12-2025 01-01-2026 02-01-2026 03-01-2026 04-01-2026 05-01-2026 06-01-2026 07-01-2026 08-01-2026 09-01-2026 10-01-2026 11-01-2026 12-01-2026 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
9,299 9,316 9,333 9,350 9,367 22-10-2025 23-10-2025 24-10-2025 25-10-2025 26-10-2025 27-10-2025 28-10-2025 29-10-2025 30-10-2025 31-10-2025 01-11-2025 02-11-2025 03-11-2025 04-11-2025 05-11-2025 06-11-2025 07-11-2025 08-11-2025 09-11-2025 10-11-2025 11-11-2025 12-11-2025 13-11-2025 14-11-2025 15-11-2025 16-11-2025 17-11-2025 18-11-2025 19-11-2025 20-11-2025 21-11-2025 22-11-2025 23-11-2025 24-11-2025 25-11-2025 26-11-2025 27-11-2025 28-11-2025 29-11-2025 30-11-2025 01-12-2025 02-12-2025 03-12-2025 04-12-2025 05-12-2025 06-12-2025 07-12-2025 08-12-2025 09-12-2025 10-12-2025 11-12-2025 12-12-2025 13-12-2025 14-12-2025 15-12-2025 16-12-2025 17-12-2025 18-12-2025 19-12-2025 20-12-2025 21-12-2025 22-12-2025 23-12-2025 24-12-2025 25-12-2025 26-12-2025 27-12-2025 28-12-2025 29-12-2025 30-12-2025 31-12-2025 01-01-2026 02-01-2026 03-01-2026 04-01-2026 05-01-2026 06-01-2026 07-01-2026 08-01-2026 09-01-2026 10-01-2026 11-01-2026 12-01-2026 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
Current #9,359
Change
Best #

Upgrade to Pro

Unlock 30-day and 90-day rank history charts with a Pro subscription.

Upgrade Now

Active Installs Growth

Active Installs 0,000,000+
Growth +0.0%
Peak 0,000,000

Downloads Growth

0 10 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
0 10 05-01-2026 06-01-2026 07-01-2026 08-01-2026 09-01-2026 10-01-2026 11-01-2026 12-01-2026 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
0 10 21-12-2025 22-12-2025 23-12-2025 24-12-2025 25-12-2025 26-12-2025 27-12-2025 28-12-2025 29-12-2025 30-12-2025 31-12-2025 01-01-2026 02-01-2026 03-01-2026 04-01-2026 05-01-2026 06-01-2026 07-01-2026 08-01-2026 09-01-2026 10-01-2026 11-01-2026 12-01-2026 13-01-2026 14-01-2026 15-01-2026 16-01-2026 17-01-2026 18-01-2026 19-01-2026 20-01-2026
0 10 20 22-10-2025 25-10-2025 28-10-2025 31-10-2025 03-11-2025 06-11-2025 09-11-2025 12-11-2025 15-11-2025 18-11-2025 21-11-2025 24-11-2025 27-11-2025 30-11-2025 03-12-2025 06-12-2025 09-12-2025 12-12-2025 15-12-2025 18-12-2025 21-12-2025 24-12-2025 27-12-2025 30-12-2025 02-01-2026 05-01-2026 08-01-2026 11-01-2026 14-01-2026 17-01-2026 20-01-2026
0 10 20 30 20-01-2025 01-02-2025 13-02-2025 25-02-2025 09-03-2025 21-03-2025 02-04-2025 14-04-2025 26-04-2025 08-05-2025 20-05-2025 01-06-2025 13-06-2025 25-06-2025 07-07-2025 19-07-2025 31-07-2025 12-08-2025 24-08-2025 05-09-2025 17-09-2025 29-09-2025 11-10-2025 23-10-2025 04-11-2025 16-11-2025 28-11-2025 10-12-2025 22-12-2025 03-01-2026 15-01-2026 20-01-2026
Downloads
Growth
Peak

Upgrade to Pro

Unlock 30-day, 90-day, and yearly download history charts with a Pro subscription.

Upgrade Now

Reviews & Ratings

4.9
14 reviews
Overall 98%
5
13 (93%)
4
1 (7%)
3
0 (0%)
2
0 (0%)
1
0 (0%)

Tracked Keywords

Showing 1 of 1
Keyword Position Change Type Updated
sourcecode 15 Tag 9 hours ago

Unlock Keyword Analytics

Track keyword rankings, search positions, and discover new ranking opportunities with a Pro subscription.

  • Full keyword position tracking
  • Historical ranking data
  • Competitor keyword analysis
Upgrade to Pro

Track This Plugin

Get detailed analytics, keyword tracking, and position alerts delivered to your inbox.

Start Tracking Free

Plugin Details

Version
3.0.1
Last Updated
Nov 24, 2022
Requires WP
4.0+
Tested Up To
6.1
PHP Version
7.0 or higher
Author
Willy Bahuaud

Support & Rating

Rating
★ ★ ★ ★ ★ 4.9
Reviews
14
Support Threads
0
Resolved
0%

Keywords

Upgrade to Pro

Unlock keyword rankings, search positions, and detailed analytics with a Pro subscription.

Upgrade Now

Frequently Asked Questions

Common questions about Pastacode

HTML
CSS
JavaScript
PHP
C
C#
C++
Java
Sass
Python
SQL
Ruby
CoffeeScript
Bash
Apache
Less
HAML
Git command line
Haskell
Markdown
Typescript
Treeview (directory structure)

If you use another syntax highligther plugins, migration scripts are available :)
What is the Treeview language?
You can use it to display a directory structure. Use pipes, backticks and hyphens like this:

root_folder/
|-- a first folder/
| |-- holidays.mov
| |-- javascript-file.js
| `-- some_picture.jpg
|-- documents/
| |-- spreadsheet.xls
| |-- manual.pdf
| |-- document.docx
| `-- presentation.ppt
| `-- test
`-- README.md
add_filter( 'option_pastacode_cache_duration', 'my_pastacode_cache_duration' );
function my_pastacode_cache_duration( $duration ) {
$duration = DAY_IN_SECOND*3; // 3 days
return $duration;
}
You can also build yours:

Paste these lines into your functions.php theme file:

add_action( 'wp_enqueue_scripts', 'custom_enqueue_script', 11 );
function custom_enqueue_script() {
$urlofmynewscheme = get_stylesheet_directory_uri() . '/prism-okaida-willy.css'; //this is an example
wp_deregister_style( 'prismcss' );
wp_register_style( 'prismcss', $urlofmynewscheme, false, '1', 'all' );
}

Get inspired of the default scheme to build your schemes
How to filter supported languages ?
Paste these lines into your functions.php theme file:

//If you just want php, html, css and javascript support
add_filter( 'pastacode_langs', '_pastacode_langs' );
function _pastacode_langs( $langs ) {
$langs = array(
'php' => 'PHP',
'markup' => 'HTML',
'css' => 'CSS',
'javascript' => 'JavaScript', );
return $langs;
}

Ajax compatibility
To enable Pastacode on ajax based websites, it need two steps:

Turn on Legacy support in the settings panel
Paste this line into your functions.php theme file: add_filter( 'pastacode_ajax', '__return_true' );
After each change on your DOM, you will have to run this javascript function: Prism.highlightAll();
//Take WordPress SVN, for example
//register a provider
add_filter( 'pastacode_services', '_pastacode_services' );
function _pastacode_services( $services ) {
$services['wordpress'] = 'core.svn.wordpress.org';
return $services;
}

//Define pastabox lightbox inputs
add_action( 'pastacode_fields', '_pastacode_fields' );
function _pastacode_fields( $fields ) {
$fields['wordpress'] = array( // 'wordpress' or 'whatever'
'classes' => array( 'wordpress' ), // same value as the key
'label' => sprintf( __('File path relative to %s', 'pastacode'), 'http://core.svn.wordpress.org/' ),
'placeholder' =>'trunk/wp-config-sample.php', //if placeholder isn't defined, it will be a textarea
'name' => 'path_id' //these value return shortcode attribute (path_id, repos, name, user, version)
);
$fields['pastacode-lines']['classes'][] = 'wordpress'; // Add ability to select lines
$fields['pastacode-highlight']['classes'][] = 'wordpress'; // Add ability to highlight somes

return $fields;
}

//Build the function to retrieve the code
// "pastacode_wordpress" hook name (1st param) = "pastacode_" + "wordpress" or "whatever"
add_action( 'pastacode_wordpress', '_pastacode_wordpress', 10, 2 );
function _pastacode_wordpress( $source, $atts ) {
extract( $atts );
if( $path_id ) {
$req = wp_sprintf( 'http://core.svn.wordpress.org/%s', str_replace( 'http://core.svn.wordpress.org/', '', $path_id ) );
$code = wp_remote_get( $req );
if( ! is_wp_error( $code ) && 200 == wp_remote_retrieve_response_code( $code ) ) {
$data = wp_remote_retrieve_body( $code );
$source[ 'url' ] = $req; //url to view source
$source[ 'name' ] = basename( $req ); //filename
$source[ 'code' ] = esc_html( $data ); //the code !!
//$source[ 'raw' ] contain raw source code. But there are no raw source code delivered by Wordpress SVN
}
}
return $source;
}

Sign In / Register

You need to sign in or register to use this feature.