Redirect wordpress from /%post_id%/%postname%/ to /blog/%postname%/
-
Hi what is the code to redirect wordpress blog from site.com/%post_id%/%postname%/ to site.com/blog/%postname%/ We are moving the site to a new server and new url structure.
Thanks in advance
-
Hi Tim, thanks for your help.
Yes wordpress will be installed in a folder /blog/
So it should be quite simple to do this redirect!
Regards Tai
-
First off, I would imagine you need your wordpress installation to be inside a /blog/ directory on your server, unless you can do some fancy redirect.
Secondly, in order to change the URL structure from post id / post name. You can do this in your wordpress settings.
Go to -> Settings -> Permalinks.
You will need to select a custom structure, something like
/%postname%/or if you wish to keep hold of the ID
/%postname%-%post_id%/Then save your settings.
Hopefully that does the trick.
Cheers
Tim
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Hostage Taking by My Wordpress Developer
Since 2013 a Wordpress developer has coded my real estate website. Their hourly rate is $24 but the programmers take too long to perform tasks and the service has become prohibitively expensive. Examples of unreasonable time estimates below: | | 1. Change theme settings so posts/pages do not display a date. -> 7 hrs
Intermediate & Advanced SEO | | Kingalan1
2.Google search results are displaying the breadcrumb on the top of each page rather than the URL. Please correct so this does not display. -> 3 hrs
3. Install SSL certificate to www.metro-manhattan.com domain -> 8 hrs | | The above does not include 5-6 hours for testing. I am considering changing vendors. Potential programmers have asked how the site was developed and to what extent is it is customized. Ends up several plugins were built from scratch. My question is whether a new developer is going to be able to pick up a custom coded site. That without understanding how the site was built, any change will break the site. My concern is that current developer has made themselves indispensable, and created a situation where there is no alternative to using them and they can therefore charge any price they want.Any thoughts? Also below are questions I asked my developer about how the site was built and their answers: | 1. Was everything coded using a child theme?
No, is a custom theme. 2. Did you use any ready made theme or just plugins
We used the theme and and we've used plugins. Third party plugins and plugins builded from scratch 3. Can Wordpress and every one of the plugin be updated?
Wordpress can be updated, core files was never modified. If after an update something start to work wrong is due to some radical wordpress change or similar Can't be updated: FireStorm Professional Real Estate Plugin Created at xxx: Form Submissions Report Miscellaneous Hooks and Filters NYC Check memory usage NYC SEO listings NYC Slider Sitemap Updater 4. Were any of the plugins customized and if so, which ones?
Yes, this plugin "FireStorm Professional Real Estate Plugin" |0 -
Duplicate/ <title>element too long issues</title>
I have a "duplicate <title>"/"<title> element too long" issue with thousands of pages. In the future I would like to automate these in a way that keeps them from being duplicated AND too long. The solution I came up with was to standardize these monthly posts with a similar, shorter, <title>, but then differentiate by adding the month and the year of the post at the end of each <title>. Hundreds of these come out every week, so it is hard to sit there and come up with a unique <title> every time. With this solution the <title> tags would undoubtedly be short enough, however my primary concern is, would simply adding the month and year at the end of each <title> be enough for Google/Moz to decide it is not a duplicate? How much variation is enough for it not to be deemed a duplicate <title>? </p></title>
Intermediate & Advanced SEO | | Brian_Dowd0 -
Help with https// redirects
Hey there
Intermediate & Advanced SEO | | Jay328
I have a client who just moved from a self hosted CMS to Adobe Catalyst (don't ask!)
The problem: Their url indexed with google is https://domain.com, Adobe Catalyst does not support third party SSL certificates or https domains. Now when people google them https://domain.com shows up in search, HOWEVER it does not have a trusted certificate and a pop up window blocks the site. They are a mortgage company so SSL is really not needed. What can I do to get google to recognize the site at http: vs. https? Would this be something in GWMT? Thanks!0 -
Category Base in Wordpress
I notice that there is a checkbox on the Yoast SEO Plugin for "strip category base". What is the reason to do this? What are the SEO advantages and disadvantages?
Intermediate & Advanced SEO | | casper4340 -
Optimizing the HomePage of a WordPress blog
Dearest SEOmozzers, I am creating WordPress blogs and I would like to know from a WordPress expert how to better optimize the homepage of a site. In particular, I'd like to know how to create an SEO-friendly homepage that I want to optimize for certain keywords. Do you think that it is better to show on the homepage the posts that I write, which change constantly, or a static, well-optimized text that will include the keywords I want to rank for? I have been naively using the changing posts, but after an analysis of the competitors I have noticed that most of them use a static text and show only the most recent post at the bottom of the page. I'd really appreciate it if you could let me know the best practice to adopt to optimize the site. Thank you. Sal
Intermediate & Advanced SEO | | salvyy0 -
Is Google mad at me for redirecting...?
Hi, I have an e-commerce website that sells unique items (one of a kind). We have hundreds of items and the items are rapidly sold. Up till now I kept the sold items under our "sold items" section but it started to get back at me as we have more "sold" than non sold and we are having duplication problems (the items are quite similar besides to sizes etc.). What should we do? Should we redirect 100 pages each week? Will Google be upset with that? (for driving it crazy) Thanks
Intermediate & Advanced SEO | | BeytzNet0 -
Blog not showing up when searching for exact post/META titles
I am working on a blog http://www.possessionista.com which is a very popular fashion blog. It is very well established with a 100% natural link profile and zero spammy stuff. The blog ranks #1 for random fashion terms like "kourtney kardashian cat eye sunglasses" and "emily maynard boots". The problem I am experiencing is that none of the actual titles of her posts or any of the content in the post results in her blog showing up if searched. EX: http://www.possessionista.com/2011/10/pippa-middletons-zip-jacket.html When you search "Pippa Middleton's Zip Jacket" on google her blog is nowhere to be found. Try searching allintitle:"Pippa Middleton's Zip Jacket" and she's nowhere to be found either. Even search "The other day, I met with my friend Kiran for our monthly mutual admiration society" on google and she's nowhere to be found even thoguh this is a unique snippet from her post. This post is already indexed and cached with the above mentioned details. i've also tested dozens of older posts as well. Same issue. You can actually do this to see a more clear picture: Do a google search for: allintitle:Bachelorette Fashion: Episode 2 - Ashley Hebert Brown site:possessionista.com That will bring up her blog which means google recognizes that the phrase is in her META title. Now do a google search for: allintitle:Bachelorette Fashion: Episode 2 - Ashley Hebert Brown without the site: included. She does not pop up but other people do. I did find that she had a duplicate title tag for a few weeks, but I've fixed that. Her posts used to pop up #1 when you search the title, but now obviously not. I am kind of at a loss and have tried a bunch of options with no success. Oh, one other thing is that some people do scrape her content, but only a few like maybe 10 and they've always been doing it even when she used to rank for her own post titles. Have you guys experienced this issue? Do you have any ideas of how to fix it?
Intermediate & Advanced SEO | | modparent0 -
How And/Or If To Prune Footer Links
Hi, I have a site with a site-wide footer that currently has 28 internal links.The footer terms are the terms the pages are focused on. This footer is on every page of the site (hundreds of pages). Some pages of my site have 10 or so additional links pointing to internal and external pages (besides the footer) and some pages (like the homepage) have about 50 links besides the footer. I'm going for a half dozen new terms with new pages that I would be adding to the site-wide footer. Do you think I should trim the existing footer before adding these new terms? I guess I would remove the terms that show no real hope of ever getting to page one... like pages stuck in the 40s. Or, pages I for whatever reason don't care much if they rank or not. Would trimming it to a smaller number do more to help the remaining linked pages/terms? What do you think? Thanks!
Intermediate & Advanced SEO | | 945010