WordPress Subcategory Creates 2 urls for same page (serious issue)

All subcategories in WordPress create 2 urls to same page. domain.com/parentcat/childcat/ domain.com/childcat/ both urls go to the same page. in the eyes of Google this is duplicate content. it seems it would be logical for WordPress to redirect domain.com/childcat/ to domain.com/parentcat/childcat/ Using WordPress 4.3 no plugins. I can't seem to find a fix for this anywhere. Any help would be appreciated.
Category: Web

Loop through posts by each term and exclude duplicate posts assigned to several terms

Okay, i'll try to go a bit more into detail. What i did with this code is getting a list of artists ordered by alphabet. In this list i'm showing all corresponding news posts to this artists term. That functions fine. But if there is a news that is corresponding to more than one of the artists i get the same post under every artist corresponded to the post. And what i wanna achieve is to show this post/news only …
Category: Web

I'm trying to remove a duplicate menu, which only appears on the homepage?

I've used Elementor and Elements Kit to create this website. It's accidentally generated a duplicate menu which only appears on the homepage and i'm desperate to remove it. I've tried to use additional CSS to remove it, but as both of the menus seem to be built up of identical HTML, I can't manipulate one without the other. Any help would be more than greatly appreciated, I'm beyond stressed out trying to solve this. Thank you so much!!
Category: Web

Automatic duplicate/copy of post to a related page in WordPress

I have a website about introducing softwares and apps. I created pages and so menus (named by categories). I set my WordPress setting homepage to latest posts. I create posts and give them categories and tags. I like to have the option to automatically create a copy of content of a post in related page, in which this relation might be its category? Is there such possibility inside WP or some free plugins? Thanks.
Category: Web

How to copy posts from one site to another in real time (not multisite)

I'm working to rebrand my company's website (new look, URL, etc.). I've already transferred all of the existing posts, pages, users, media from site B (old) to site A (new) and I have site A up and running for me to design around now. My question is this: Is there a way that when a user publishes a post on site B that it can also create that post on site A, so when I eventually deactivate site B all …
Category: Web

Multisite - Cloning CPT pages + content (including ACF Flexible Content) from site to site

I wondered if anyone had any WordPress Multisite knowledge where I need to be able to move pages and content from one site to another? A little bit of background, I've done this previously using the 'Multisite Post Duplicator ' plugin (https://wordpress.org/plugins/multisite-post-duplicator/) however this plugin hasn't been updated in 3 years and i'm not sure whether this will do the job now that the core would have been updated many versions since then. I've looked at a number of plugins …
Category: Web

Duplicate posts when posting nulls in records in phpMyAdmin

I have a phpMyAdmin database with a table whose contents, when inputted from the database, automatically publish the related information. Some of the details within the record may be NULL, and while testing I encountered the issue that if any of the content within any record is NULL, all the records are duplicated when reloading from wp-admin. The number of records within the database remains unchanged. I am quite sure there is a way to deal with NULLS in this …
Category: Web

Prevent Duplicate Post Counted by Query

<?php while ( have_posts() ) : the_post(); $get_series_id = get_post_meta( get_the_ID(), 'series_seri', true ); if (in_array($get_series_id, $do_not_duplicate)) { continue; // We've already seen this post ID, so skip the rest of the loop } $do_not_duplicate[] = $get_series_id; ?> <?php the_title(); ?> <?php endwhile; wp_reset_postdata(); ?> how to make duplicate post not counted ? i wanna show 20 post, but in frontpage only showing 5 post because duplicate post also counted,
Category: Web

How to change title tags on paginated posts?

I've created many post with multiple pages with the nextpage-tag. The problem is that these show up as errors in "Google Webmaster Tools" because of duplicate title tags and meta descriptions. The urls are like this: http://mypage.com/mypost/ http://mypage.com/mypost/2 http://mypage.com/mypost/3 all of which have the same title and meta tags. Is it somehow possible to include the page number to the meta tags? I'm using the "WP SEO" which surprisingly doesn't have this feature.
Category: Web

How can I post exact same post but with a few things changed? (with some sort of Automation)

I wanna duplicate some of my posts but want to change a few variables. For example, I would just like to make some variable in my posts that will be changed every time I give inputs. These can be links or one word changes in post title or somewhere in post. How can I do it? (see an example below where XXXX and Y are variables) Post Title: Hello this is a sample Post with XXXX - Read now! Body …
Category: Web

Is it possible to create duplicate post on other site (either push, on publish, or pull, periodically)?

I have a requirement to add certain posts (marked with a tag or category) from "site a" to another site ("site b"). I think the best way would be for site b to periodically check site a for the presence of new posts in the category or with the keyword, but perhaps it would be better for site a to push select new posts to site b at time of publication. The posts should look like they are locally stored …
Category: Web

Check for duplicate custom field value before running wp_insert_post

That is, I want to prevent 'guid_review' ACF value being duplicate by checking it before creating the post. foreach ($items as $itemKey => $item) { $myPost = array( 'post_type' => 'client_review', 'post_title' =>(string) $item->title, //the object as a string before attempting to manipulate it. 'post_content' =>(string) $item->description ); $inserted_post_id = wp_insert_post( (array) $myPost ); if( $inserted_post_id ){ add_post_meta( (int) $inserted_post_id,'guid_review',(string)$item->guid); add_post_meta($inserted_post_id,'link_review',(string)$item->link); add_post_meta($inserted_post_id,'author_review',(string)$item->author); add_post_meta($inserted_post_id,'rating_review',(string)$item->children('d3', true)->rating); add_post_meta($inserted_post_id,'certified_review',(string)$item->children('d3', true)->certified); add_post_meta($inserted_post_id,'pub_date_review',(string)$item->pubDate); } }
Category: Web

twenty seventeen customizer duplicates section content

Here's a thing that baffles me. Others have reported similar problems but none that match exactly, and being pretty new to WordPress, I find myself a bit at a loss. Using the twentyseventeen theme I succeeded in getting a static homepage with four sections that are each drawn from pages with their own featured photo. Everything was working fine until I made some modification that I couldn't now identify, and now the content of the top section is duplicated where …
Category: Web

WP_Query offset is returning post from prevois loop

On archive pages, I let WordPress handle the archive page and load the first 10 posts, then I load more posts with AJAX requests, and this AJAX request is returning weird results. My query inside the AJAX handler looks like this: $query_args = array( 'post_type' => 'post', 'posts_per_page' => get_option( 'posts_per_page' ), // 10 by default 'offset' => get_option( 'posts_per_page' ), // 10 by default 'cat' => 8 // the category ID ); $wp_query_archive = new WP_Query( $query_args ); The …
Category: Web

Auto-create a pretty permalink for a bunch of posts

I have spammed many duplicate posts from one initial and now after editing them the url structure for them is something like http://example.com/base-name-copy-20 where base-name is the slug of the duplicated initial post. Now, I could change the permalink for every one of them manually I know, but is there a way to create a slug for those duplicated posts anew ? I have edited them so they all have their own title now, but the permalink is already set. …
Category: Web

The best way to store variable across different widgets

The front page of my site building with set of widgets. Each widget shows the rows with posts for some criteria. I want to exclude duplicate posts across different widgets. The simplest way comes to mind is to use global variable. For example: global $exclude; $query = new WP_Query([ 'posts_per_page' => publish, 'post__not_in' => $exclude ]); $exclude = wp_list_pluck( $query->posts, 'ID' ); I want to find better way to do this job. I've thought about wp_get_cache, but it seems that …
Category: Web

$do_not_duplicate is not working in genesis theme

I'm using Genesis child theme and I am using this function to display feature posts on home page. function modern_motoroids_extra_feature_posts(){ ?> <?php $do_not_duplicate = array(); ?> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?> <?php query_posts( array('meta_key' => 'feature-story', 'orderby'=> 'date', 'paged' => get_query_var( 'paged' ), 'posts_per_page' => 4, 'post__not_in' => $do_not_duplicate)); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php $do_not_duplicate[] = get_the_id(); ?> <?php echo get_the_titke(); ?> <?php endwhile; endif; ?> …
Category: Web

Best way to prevent post duplication when using multiple loops

I have the following loops on a page on my website. Whats the best way to adapt the code below to stop the post in my first loop, being repeated in the second? <?php query_posts('showposts=1&post_type=post'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div id="latestpost" <?php if ( $thumbnail_id = get_post_thumbnail_id() ) { if ( $image_src = wp_get_attachment_image_src( $thumbnail_id, 'normal-bg' ) ) printf( ' style="background-image: url(%s);"', $image_src[0] ); } ?>> <article id="post-<?php the_ID(); ?>" …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.