How to change Divi Project slug to something else

Jun 27, 2018 | Divi Tips

Are you using the Divi Projects for something other than projects? You may want to change the permalink (or URL) to say something other than โ€œprojectโ€.

Youโ€™ll need to use a child theme and paste the following into the functions.php file.

The code below will change “Projects” to “Case Studies”. Just change 3 lines below to whatever you like.

/* Change the Divi Project Post Type Name and Slug BEGIN */
function dbc_projects_custom_slug($args) {
    $slug = 'case-studies';
    $slug = sanitize_title($slug, 'project');
    if (is_array($args) && !empty($slug)) {
        $args['slug'] = $slug;
    }
    return $args;
}
add_filter('et_project_posttype_rewrite_args', 'dbc_projects_custom_slug');
function dbc_projects_custom_name($args) {
    $name_singular = 'Case Study';
    $name_plural = 'Case Studies';
    if (isset($args['labels']) && is_array($args['labels'])) {
        if (!empty($name_plural) && $name_plural !== 'Projects') {
            $args['labels']['name'] = esc_html__($name_plural, 'et_builder');
            $args['labels']['search_items'] = esc_html__("Search {$name_plural}", 'et_builder');
            $args['labels']['all_items'] = esc_html__("All {$name_plural}", 'et_builder');
        }
        if (!empty($name_singular) && $name_singular !== 'Project') {
            $args['labels']['singular_name'] = esc_html__($name_singular, 'et_builder');
            $args['labels']['add_new_item'] = esc_html__("Add New {$name_singular}", 'et_builder');
            $args['labels']['edit_item'] = esc_html__("Edit {$name_singular}", 'et_builder');
            $args['labels']['new_item'] = esc_html__("New {$name_singular}", 'et_builder');
            $args['labels']['view_item'] = esc_html__("View {$name_singular}", 'et_builder');
        }
    }
    return $args;
}
add_filter('et_project_posttype_args', 'dbc_projects_custom_name');
/* Change the Divi Project Post Type Name and Slug END */

Need help with this?
Hire me for a consultation and I’ll walk you thru the process.

5 star reviews
“WOW! Money WELL spent. Joseph was incredibly knowledgeable in helping me make some final tweeks to my Divi website. He was very caring and went above and beyond. Will 100% use him for any future Divi website needs.”
Claire – CMMC

5 star reviews
“You really get what you pay for with Joe. He does more than simply build a website, he sets up websites for success. Functional, clean, professional designs and he keeps up/implements the latest plugins and technology. Thank you Joe. I will continue to refer you work.”
Mark Winger

5 star reviews
“The best WordPress guy Iโ€™ve worked with on WordPress, hands-down (and Iโ€™ve worked with dozens). Remarkably good with theme customizations with a quick turn. Kept it on budget as well. A rarity with hourly contracts.”
Nate Wright

5 star reviews
“Thanks for your prompt reply. Youโ€™re always so comprehensive. If we could write another review just for your communication skills, then we would.”
Alex N

More Tips

Ask a Question

Tell me about your project. The more details the better.

"*" indicates required fields