This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 18 replies, has 2 voices.

Last updated by Bobby 2 months, 3 weeks ago.

Assigned support staff: Bobby.

Author Posts
May 28, 2019 at 9:36 pm #3910383

seanS-21

Tell us what you are trying to do?

I'd like to see where WPML is redirecting from hidden link to hidden link , and then perhaps change or disable that redirect.

I'm confident that WPML is controlling this redirect because if I disable the WPML plugin, the redirect stops working. The redirect resumes working when I reenable the WPML plugin.

Is there any documentation that you are following?

I'm not sure where to look. When I searched WPML's documentation, I didn't see anything about a list of redirects or a dashboard from which to manage them.

Is there a similar example that we can see?

Yes, see hidden link

This redirects to hidden link when the WPML plugin is active.

What is the link to your site?

hidden link

May 28, 2019 at 11:13 pm #3910493

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

WPML by itself does not have a function to add redirects as would an SEO(Yoast SEO) plugin or redirect plugin

therefore i wonder if you added a category by any chance and created a translation for it?

as a test what are your results if you leave WPML activated but deactivate WPML String Translation add-on plugin ?

May 29, 2019 at 2:57 am #3911311

seanS-21

Hi Bobby, thanks for taking my support request.

If I leave the "WPML Multilingual CMS" plugin activated but disable the "WPML String Translation" plugin, the site redirects /virginia/ to /state/virginia/ .

If I disable the WPML Multilingual CMS plugin, then /virginia/ does not redirect.

I've tested disabling all plugins and using on of the stock WordPress themes, and the result is the same -- if WPML Multilingual CMS is active, the redirect happens, and if WPML Multilingual CMS is deactivated, then he redirect does not happen.

There _is_ a "state" category. I'm not aware that there's a translation for it, but I'm not sure where to look for that because it's been years since I last worked with WPML.

Thank you for any help.

May 29, 2019 at 3:17 pm #3916815

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

If possible i would like to take a closer look

**Before we proceed I recommend to please take FULL BACKUP of your database and your website.**
I often use the Duplicator plugin for this purpose See: http://wordpress.org/plugins/duplicator/

I would like to request temporary access (wp-admin and FTP) to your site

You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you will enter is private which means only you and I can see and have access to it.

Thank you,
Bobby

May 30, 2019 at 12:23 am #3919165

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi There,

The slug for "states" is added by the theme/plugin you are using to add the functionality of "States" to your site

if you go to States=>view your states and edit Virginia for example you will see /state/ in the permalink

even with WPML deactivated i am able to get this behavior

May 30, 2019 at 7:59 pm #3925987

seanS-21

Hi Bobby, I think that what you were seeing was cached after another WPML rep was working on the site to help with another issue.

I've cleared the cache again, so could you please try these links?

These links do not redirect when WPML is disabled, and I've temporarily disabled WPML on this dev site.

hidden link
hidden link

When I re-enable WPML on this site, the redirects happen again. I'm able to recreate this consistently, barring cache issues (sorry!).

June 12, 2019 at 5:54 pm #4006715

seanS-21

Hi Bobby, please excuse the delay in my reply. I was waiting for another open issue to get resolved before coming back to this, but it looks like that might not be feasible any more.

Per your request, I don't have a way to load the custom theme onto your site, but you have FTP access to my site, so is this something that you can do?

You are correct when you write the following:

"please go to States-> and edit any of the states , then examine their permalinks , notice that /state/ is within the permalink".

As part of the theme, yes, we have a custom post type, "state", which adds /state/ as part of the URL.

So for example, if I have a state of "Virginia", then the URL will include /state/virginia/

However, the issue is that if I disable the WPML plugin, then /virginia/ stops redirecting to /state/virginia/.

June 12, 2019 at 5:56 pm #4006735

seanS-21

... Please note that while I'm still troubleshooting the other WPML issue, the "joedev" site might have its plugins and theme disabled, intermittently.

I can create a second site if needed, or we can troubleshoot using your hosting, if you can duplicate the site. Feel free to duplicate the site and enable the "CCA" theme, if easier.

June 12, 2019 at 8:05 pm #4007407

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

please feel free and create a duplicate site that we can test this on as our sandbox enviroment expires after 7 days of non activity

Now regarding the issue , being that /state/ is already added through your custom type it is actually the correct permalink structure to include /state/virginia rather than dropping /state/

WPML is grabbing the correct link to this cpt, as this is not a bug from WPML i dont see how we could alter WPML's behavior of grabbing the correct URL which is /state/virginia/ , perhaps you could add a redirect but at this point we would be dealing with a custom theme and custom work which unfortunately we cannot cover within the forum

June 13, 2019 at 5:55 am #4009571

seanS-21

Hi, I've eliminated the possibility that the problem is related to a custom theme. Please see here:

hidden link

On this new test site, I've created a child theme for the stock Twenty Nineteen theme.

The child theme does one thing -- it creates a basic template for the custom post type, "state"; otherwise, this theme is stock.

I've also created a custom plugin for this site, named "State Post Type". This plugin does one thing -- it registers the custom post type, "state".

At the moment, there are only two plugins activated on this site:

1. The custom post type plugin
2. The main "WPML Multilingual CMS" plugin

Now, on this test site, when WPML is enabled, then /ohio/ will redirect to /state/ohio/.

When WPML is disabled, then /ohio/ will not redirect. Instead, /ohio/ it will show a Media page written in Spanish.

Where is WPML controlling this redirect?

June 13, 2019 at 6:25 pm #4016243

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

i have consulted my colleagues regarding this issue

WordPress does URL guessing and we also do this in WPML

since the actual permalink by default includes /state/ohio/ when you call just /ohio/ it prompts WordPress to do a URL guess.

Within our code the following is responsible for the 'guess'

function maybe_adjust_name_var() does the guessing and the redirect is here:

/sitepress-multilingual-cms/classes/query-filtering/class-wpml-query-parser.php . #L330

June 13, 2019 at 7:45 pm #4016703

seanS-21

Thank you, Bobby. Is there an option to toggle this behavior on or off within WPML?

Also, can you tell why the /ohio/ page and other /$statename/ pages are in Spanish by default? The site is English by default.

June 13, 2019 at 11:43 pm #4017413

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Unfortunately this is not a feature that we have out of the box , you can use custom code to change the default code of WPML if you wish but do note that this is not recommended by our developers.

Additionally do remember that WordPress does URL guessing by default as well. Possibly considering a 301 redirect for the url might be a better option , but this is just my suggestion.

Regarding the language , is WPML activated at the moment ?

I currently don't have access to the backend , the previous credentials are no longer working , please test it as taking a closer look would help give me a better idea

Please do note that our support is limited when it comes to any custom work and that is why we recommend contacting our 3rd party WPML contractors
=> https://wpml.org/contractors/

June 14, 2019 at 6:39 pm #4023765

seanS-21

Hi Bobby, I remembered that URL guessing normally only happens when there's a problem, such as a 404 error or an otherwise invalid URL.

However, in this case, /wyoming/ is a valid URL, so why is WPML redirecting it when WPML is activated?

(At the moment, WPML is not activated on he stateredir site, which is why it's not redirecting at the moment.)

I see mention of a possibly related bug on the WPML forum here, where WPML was forcing undesired redirects, here:
https://wpml.org/forums/topic/strange-redirections-occuring-as-soon-as-wmpl-is-enabled/

Maybe this bug has returned to WPML, or there's a similar problem again?

June 14, 2019 at 7:13 pm #4023833

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

At the backend when you go to add a state , please share with me the screenshot of your URL within the state edit page (the permalink is found underneath the title)

NOTE : the issue mentioned above has since been fixed and it was mainly caused due to the user using the same/similar slug (rooms-suites), they were not trying to drop the "/hotels/" part which is equivalent to "/state/"

the issue that i see here so far has been that your default permalink includes /state/ within it by default.

if possible please provide me with access to take a closer look

The topic ‘[Closed] Where can I see and manage redirects within WPML?’ is closed to new replies.