Change Divi Projects URL-Permalink
If you find this tweak helpful:
Tweaking Elegant Themes involves creating a child theme and editing PHP and CSS files within a text editor. If you have never done this you may want to read our guide on creating a child theme. All tweaks are written with the assumption that you have a default installation of your theme. Any tweaks or changes you may have previously made to your theme could affect the outcome of the tweaks on this site. All tweaks should be tested before applying to a live site.
This tweak changes the URL structure of Divi Projects from /projects/ to whatever you want like /photos/. It’s an easy fix that requires little effort. You can take a shortcut that makes this tweak super easy, but not future proof. I would recommend the long version, especially if this is for a client’s website.
Just so we are all on the same page, when you create a new project in Divi, the URL structure of the project looks like this: www.example.com/projects/. That’s if you have pretty permalinks turned on. The tweak below allows you to change projects to anything you want to better match your desired URL structure.
*Updated – I have found a new way to replace the ‘project’ slug without overwriting the entire function, by creating a filter. Same result, but less code. I have updated the tweak below with the new method.
The long but correct way to do this:
Locate the functions.php file in /themes/Divi-child/
If you do not have a child theme set up with a functions.php file, follow this guide.
Copy the following code and place it in the functions.php file:
Change project to whatever you would like the new slug to be and save the file. Go to the WordPress dashboard->Settings->Permalinks and click the update button. That’s it. Any current and all new project URLs will be replaced with the new slug. That’s the long way and is better because when a new version of Divi is released, this will not be overwritten. It’s not completely future-proof though. If Divi changes this function in a new release, you may have to update the code to reflect those changes in the file we just edited.
The short version:
If the above method sounds like too much work, the easier method is to simply make this change in the Divi theme.
Locate the functions.php file in /themes/Divi/
Near line 285 you should see this line:
‘slug’ => ‘projects’,
Change projects to whatever you would like the new slug to be and save the file. If you update Divi in the future, you will have to make this change again because it will almost certainly be overwritten by the update.
* As others have pointed out in the comments, you may have to go to Settings->Permalinks and click on the save changes button for the slug to change.