Source: https://divicake.com/divi-code-snippet-generator/

# Divi Code Snippet Generator

Tick the tweaks you need and we email you the code for your child theme's functions.php. Every snippet is checked against the Divi source code and works on Divi 5 and Divi 4.

Free · No account needed · Tested on Divi 5.15 and Divi 4.27

Pick your snippets

Remove the Projects post typeHides Divi's Projects, Project Categories and Project Tags from the admin, the front end, menus, search and the REST API.

Rename Projects in the adminGives the Projects post type your own name in the WordPress admin, for example Portfolio.

New nameOne item is called

Change the Projects URLChanges /project/ to a slug of your choice, and the category and tag URLs to match.

New URL slugLowercase letters, numbers and dashes, e.g. portfolio or our-work.

Allow SVG uploads (administrators only)Lets administrators upload SVG files to the Media Library.

Change the Blog module's "read more" textReplaces the "read more" link under each post in Divi's Blog module, which has no setting for it.

Link text

Keep the footer copyright year currentReplaces {year} in Divi's footer credits with the current year, so it never goes out of date.Function prefixYour site or company name in lowercase, e.g. acme. It keeps these functions from clashing with others.

Your email *

By sending it you agree to let us email you the code and to subscribe to occasional email updates from Divi Cake. Unsubscribe any time. [Privacy policy](https://divicake.com/privacy/)

Company website

Email me the codeEmail me the codeEmail me the code

## Emailing your result

- Checking your email address
- Putting your result in an email
- Sending it to you

## Your code is on its way

We sent it to your inbox. It usually lands within a minute. Nothing there after two? Check your spam and promotions tabs; the email comes from divicake.com.

[Make a free child theme for itMake a free child theme for itMake a free child theme for it](https://divicake.com/divi-child-theme-generator/)[Use the tool againUse the tool againUse the tool again](https://divicake.com/divi-code-snippet-generator/)

## No code needed: Divi already has a setting

People often look for a snippet for these. Divi does them with a switch, which survives updates and is easier to undo than code.

Stop loading Google FontsDivi → Theme Options → General → Use Google Fonts

Add tracking or verification code to the headDivi → Theme Options → Integration → Add code to the < head > of your blog

Turn the Divi Builder on for a custom post typeDivi → Theme Options → Builder → Post Type Integration

Critical CSS and deferring jQueryDivi → Theme Options → Performance

Change the Blog module's excerpt lengthThe Excerpt Length setting in the Blog module itself

Upload custom fontsThe font picker in any module's Design tab, which has an upload option

Choose who can use the Divi BuilderDivi → Role Editor

## More free Divi tools

[

### Divi Child Theme Generator

A ready-to-install child theme for Divi or Extra, zipped and sent to your inbox.

Open the tool →](https://divicake.com/divi-child-theme-generator/)[

### Divi Website Cost Calculator

Pick your pages and features and get what a Divi website costs in your inbox, before you ask anyone for a quote.

Open the tool →](https://divicake.com/divi-website-cost-calculator/)[

### Divi Theme Detector

Enter any website and find out whether it runs Divi 4, Divi 5 or Extra, and which Divi plugins it uses.

Open the tool →](https://divicake.com/divi-theme-detector/)[

### Divi AI Prompt Generator

Answer a few questions and we email you a prompt that has an AI assistant plan or build your Divi 5 page.

Open the tool →](https://divicake.com/divi-ai-prompt-generator/)

## When the fix is bigger than a snippet

Snippets cover the small tweaks. When a site needs real fixing, a feature Divi does not have, or a move from Divi 4 to Divi 5, the team behind Divi Cake does it for a fixed price.

[01

### Fix a site

Something broken, slow or half-finished? We find the root cause and fix it properly.

from $199

See the service →](https://divicake.com/fix-existing-site/)[02

### Divi plugins

Custom Divi modules, extensions and WordPress plugins that add exactly what your site is missing.

from $999

See the service →](https://divicake.com/divi-plugin-development/)[03

### Divi 5 migration

Your Divi 4 site moved onto Divi 5, page by page, with every layout checked after conversion rather than assumed.

from $299

See the service →](https://divicake.com/divi-4-to-divi-5-migration/)

Prices are starting points · Free quote after we see the brief

[Request a quoteRequest a quoteRequest a quote](https://divicake.com/contact/)[See all servicesSee all servicesSee all services](https://divicake.com/services/)

## Divi code snippet questions, answered

Where do I paste these snippets?

In your child theme's functions.php, below the opening <?php line. Never paste them into Divi's own functions.php: the next Divi update replaces that file and your code with it. No child theme yet? The free Divi Child Theme Generator makes one in a minute.

Do the snippets work on Divi 5?

Yes. Every snippet was checked against the Divi 5.15.1 and Divi 4.27.5 source code, and run on a Divi 5 site, before it was added. They work on both versions.

Why is there no snippet to turn off Google Fonts?

Because Divi already has a switch for it: Divi → Theme Options → General → Use Google Fonts. The same goes for head code, the builder on custom post types and the performance options. A snippet for something Divi already does only gives you two places to look when it stops working, so the list on this page points you to the setting instead.

What does the function prefix do?

It starts the name of every function in the code. WordPress stops with an error if two functions share a name, so a prefix of your own (your site or company name) keeps these snippets from clashing with your theme or plugins.

Something broke after I pasted a snippet. What now?

Remove the snippet you just added from functions.php, through your host's file manager or FTP if you cannot reach the dashboard. Every snippet only adds behaviour through a filter, so taking it out puts things back the way they were.
