# Gutenberg : override core blocks rendering

> So, you’re fiddling with the Gutenberg editor and it all seems like fun. You create some custom blocks (I highly recommend Create Guten Block for this) and realise how much it is fun but […]

Source: https://antistatique.net/en/blog/gutenberg-override-core-blocks-rendering

Category: Development

# Gutenberg : override core blocks rendering

Author(s)

[

![Flavien](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/assets/avatar.png)



](#)

[Flavien](#)29 January 2019

So, you're fiddling with the [Gutenberg editor](https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks/) and it all seems like fun. You create some custom blocks (I highly recommend [Create Guten Block](https://ahmadawais.com/create-guten-block-toolkit/) for this) and realise how much it is fun but complex to build some efficient and clever blocks.

![Wordpress, Gutenberg. Agence web Genève Lausanne](https://images.statique.ch/t/w_750,f_jpeg,q_70/wp/app/uploads/2020/12/Wordpress_Gutenberg_Antistatique-1024x647.png)

Suddenly, you find yourself in the need of implementing this neat and amazing Js gallery plugin which will make your website look so cool!

Creating your own gallery block seems like a tedious task, and the existing `core/gallery` works already perfectly in the backend. So let's simply change the way the gallery block is rendering on your website, so you can have you kick-ass look without having to worry about the editing experience, which has already been taken care of!

## How?

The easiest way to achieve this, is to consider the gallery as a [Dynamic block](https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/block-tutorial/creating-dynamic-blocks/) and re-declare its render through PHP:

-   Declare the block in you chosen php file using the `init` hook (typically inside of your them's `functions.php` file).
-   Use the **exact same block name** as the one you want to override. (here `core/gallery`)
-   Only use the `render_callback` key to target you own function

**And ta-da!** Nothing more is required, the gallery plugin still works the same in the backend, and you are free to experiment all you like with your new render.

This works for **all core gutenberg blocks**, which means you can take advantage of the great blocks already developped, and arrange their output as you wish. If you want some nice documentation about the core gutenberg blocks, I recommend [Gutenberg Blocks: A Complete List & How to Use Them](https://gogutenberg.com/blocks/)

## More articles

Author(s)

[

![Anthony](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2024/11/anthony-1-300x300.png)



](/en/agence/anthony-salamone)

[Anthony](/en/agence/anthony-salamone)28 September 2026

### [Smashing Conference Freiburg 2026](/en/blog/smashing-conference-freiburg-2026)

Back in Freiburg for Smashing Conference 2026: AI and design systems, deeply technical CSS and HTML, and more human talks about teams and mindset. Here's what we took away.

Back in Freiburg for Smashing Conference 2026: AI and design systems, deeply technical CSS and HTML, and more human talks about teams and mindset. Here's what we took away.

[

![Smashing Conference Freiburg 2026 poster](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/assets/blog/smashing-2026.png)



](/en/blog/smashing-conference-freiburg-2026)

Author(s)

[

![Akira](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2025/03/akira-small-300x300.jpg)



](/en/agence/akira-kamata)

[Akira](/en/agence/akira-kamata)22 July 2026

### [Making of : “La nuit des Losers”](/en/blog/making-of-la-nuit-des-losers)

lanuitdeslosers.ch, built fast: paper wireframes, a bold hand-drawn identity, then Claude Code to prototype and ship. A mouse-tracking hero animation, a bowling game made of sponsor logos, and a few bugs we’re keeping.

lanuitdeslosers.ch, built fast: paper wireframes, a bold hand-drawn identity, then Claude Code to prototype and ship. A mouse-tracking hero animation, a bowling game made of sponsor logos, and a few bugs we’re keeping.

[

![Making of : “La nuit des Losers”](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/wp/app/uploads/2026/05/La-nuit-des-Losers-Teaser-1-768x576.png)



](/en/blog/making-of-la-nuit-des-losers)

Author(s)

[

![Pierre](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2020/12/Pierre-300x300.jpg)



](/en/agence/pierre)

[Pierre](/en/agence/pierre)7 July 2026

### [Dark mode: necessity or trend](/en/blog/dark-mode-necessity-or-trend)

Nous faisons le tri entre idées reçues, réalités techniques et bonnes pratiques de design.

Nous faisons le tri entre idées reçues, réalités techniques et bonnes pratiques de design.

[

![Dark mode: necessity or trend](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/wp/app/uploads/2026/07/1-768x384.png)



](/en/blog/dark-mode-necessity-or-trend)
