How can I get the list of all pages URLs including their shortlink IDs?
You can get this from the guid column in the posts table of your database.
You can get this from the guid column in the posts table of your database.
Go into the wp-options table. Change the URL of your site in two places to https://www.example.com . Or go into the Admin, Settings, General, and fix the URL there. (The setting on that screen reads the value from the wp-options table.) Make sure there are no URL settings in the wp-config.php file. Any setting in … Read more
Are you sure you have correct regex? Also you shouldn’t use flush_rewrite_rules() on init hook. Better to just go and re-save permalinks options in admin, so you won’t flush rules every time. Try to change regex to all chars, otherwise it looks good. add_rewrite_rule (‘^([^/]*)/?’, ‘index.php?lang=$matches[1]’, ‘top’); UPDATE: and then you need to add parameter … Read more
The easiest way would be to create a custom post type with an archive. <?php register_post_type(‘resource’, array( // Enable Core Categories and Tags ‘taxonomies’ => array(‘category’, ‘post_tag’), // Enable in REST API so it works with the Block Editor ‘show_in_rest’ => true, ‘label’ => ‘Resources’, ‘public’ => true, ‘supports’ => array(‘title’, ‘editor’, ‘excerpt’, ‘thumbnail’, ‘revisions’), … Read more
This is possible, if a little involved. To achieve this you will need: A custom query var. A filter that sorts results based on the query var. A rewrite rule for the archive that applies the query var for your pretty URL. Another rewrite rule for the same thing, but including pagination. Check for the … Read more
That’s expected. WP doesn’t build in redirects from old permalink structures to new, since the before and the after could be so many different ways. You’ll need to add your own redirects, which will have to be done one by one, since there’s no way for the server to tell what category any given post … Read more
Download IIS Rewrite from https://www.iis.net/downloads/microsoft/url-rewrite. Install and restart IIS Then modify the web.config Edit web.config, add the rewrite code. <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <defaultDocument> <files> <add value=”index.php” /> </files> </defaultDocument> <rewrite> <rules> <rule name=”Main Rule” stopProcessing=”true”> <match url=”.*” /> <conditions logicalGrouping=”MatchAll”> <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” /> <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” /> </conditions> <action type=”Rewrite” … Read more
$query_args = array( ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’, ‘parent’ => 0, ); $pages = get_pages( $query_args ); Function get_pages() accepts parameter with parent. Keeping it 0 (zero) will give us first level pages. In the example $pages will contain the first level pages. Use loop for $pages and you can use it in option … Read more
No, there is no permalink. Because it’s a bespoke URL there’s nothing to latch on to. You’d need to generate such a function yourself from scratch. Luckily, your URL is just the word login/ with an ID on the end, so when you need a URL, just write out login/ and put the ID on … Read more
When you are in the page you want to update, you can modify the slug at the top above the editor: By default WordPress uses the Page title, but you can change the ‘slug’ to whatever you want. You can also look at Settings > Permalinks for some more options.