Redirecting “wrong” but working links to their canonical URL in order to prevent search engine penalties (e.g. /123/ at the end of URLs)

Ensure that you provide a canonical url – this should ensure that search engines don’t see the url variants as duplicate content. Additionally, appending a number on the url, will make WordPress try to access that page. Using a debug plugin, such as Debug Bar, is quite useful for diagnosing this kind of behaviour as … Read more

Relative links in Gutenberg

It doesn’t have anything to do with Gutenberg. It’s just the way WordPress stores links in the main content. Anytime you add a link in the WP editor, it automatically puts in the absolute path. ACF and other forms of custom postmeta instead store the post ID, so whenever its slug/permalink changes they are automatically … Read more

I’ve removed my /author/ slug but it clashes with new and existing pages. Any fixes?

There is no way around uniqueness being necessary, with the effects you described. Personally I wouldn’t remove the part that makes ensuring uniqueness of the slug much easier, like the author part, in my mind it is just a sign of a well structured site. Anyhow, there is validate_username() function with the validate_username hook. You … Read more

custom query var NOT working on a plain permalink: http://10.8.10.9/?page_id=1774/?location=968&floor=1

I think you should really try to make the permalinks work on your server. It seldom fails. Have you checked all your server settings are correct, and have you visited the permalink page after updating, so that the cache is flushed? Otherwise you would have to have http://10.8.10.9/?page_id=1774&location=968&floor=1 and that would work too. I’d really … Read more

Remove a link from a page ID used within an array [closed]

I have updated your code please try this and let me know if any query <div class=”row”> <?php $pages = array(54,55,56,57,58,74,75,76,77,78); $i = 1; foreach ($pages as $page) { $post_data = get_post( $page ); //print_r($post_data); $title = $post_data->post_title; $content = $post_data->post_content; $string = substr($content, 0, 0); $themeta = get_post_meta($page,true); $metalink = $themeta[0]; if (has_post_thumbnail($page) ): … Read more

Permalink sub-routing catch-all

You can add an internal rewrite so WordPress recognizes these requests. In the same function hooked to init where you add the post type, you can add: add_rewrite_tag( ‘%tutorial_fragment%’, ‘([^/]+)’ ); add_rewrite_rule( ‘tutorial/([^/]+)/([^/]+)/?$’, ‘index.php?tutorial=$matches[1]&tutorial_fragment=$matches[2]’, ‘top’ ); The value is available via the WP API after the request is parsed: $value = get_query_var( ‘tutorial_fragment’ ); After … Read more

404 on internal pages, in all sites in my local server

This can be related to your overall Apache configuration and have nothing to do with WordPress itself. By default, Apache will not load any custom .htaccess files, you need to set AllowOverride for the given directory like so <Directory /path/to/site> AllowOverride FileInfo # etc </Directory> FileInfo should suffice, if not, try All and check the … Read more

Redirect From Url To Url

The easiest way to do is by using Redirection plugin. Follow these steps: Install and activate the plugin. Head to Tools > Redirection. Enter your Source URL (example.com/car/cadillac/image/) and Target URL (http: example.com/car/cadillac/). Finally, click on “Add Redirection” button.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)