Elementor Pro has a new widget, video playlist. It appends a parameter to the URL, like so: http://aaronpenton.net/ampcreative/vip/about-vip/?playlist=f68425e&video=b8a9967
This is obviously terrible for SEO and UX. Is there a way to remove the ?playlist=f68425e&video=b8a9967 ?
2
Answers
This should do the trick.
split
, well.. splits the string into an array by the/
character.
At index
6
the array contains the?playlist=f68425e&video=b8a9967
substring which can than be removed (i.e. replaced by the empty string) usingreplace
.A more general approach to removing the last part of the url might
be to use the array length instead of specifying the index:
Update:
Another way to do this is using the URL API
or in a function:
You might have to check the specification for further details (browser support etc)
My brother help me with the next script.
Put a "HTML Elementor Widget" with the following: